访问数据库2010的水晶报告 - 登录错误 - ADO连接 [英] crystal reports with access database 2010 - Logon Error - ADO connection

查看:119
本文介绍了访问数据库2010的水晶报告 - 登录错误 - ADO连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到登录错误但不确定原因。我正在尝试使用ADO连接启动晶体。

代码在Access / VB中,A​​ccess数据库扩展名为.accdb



I'm getting a logon error and not sure why. I'm trying to launch crystal using ADO connection.
The code is in Access / VB and the Access db extention is .accdb

Dim crxApplication As CRAXDRT.Application
Dim report As CRAXDRT.report

CrViewer1.DisplayBorder = False          'MAKES REPORT FILL ENTIRE FORM
CrViewer1.DisplayTabs = False            'THIS REPORT DOES NOT DRILL DOWN, NOT NEEDED
CrViewer1.EnableDrillDown = False        'REPORT DOES NOT SUPPORT DRILL-DOWN
CrViewer1.EnableRefreshButton = False    'ADO RECORDSET WILL NOT CHANGE, NOT NEEDED

Set crxApplication = New CRAXDRT.Application
Set report = New CRAXDRT.report
Set report = crxApplication.OpenReport("P:\Inventory\Reports\Test.rpt")

report.DiscardSavedData

'report.Database.Tables.Item(1).SetLogOnInfo "P:\Inventory\Test\", "Spawntestbe", "admin", ""
report.Database.Tables.Item(1).SetLogOnInfo "", "", "admin", ""

CrViewer1.ReportSource = report
CrViewer1.Height = 13000
CrViewer1.Width = 14000
CrViewer1.ViewReport

推荐答案

检查这个

C#Crystal Reports动态登录参数 [ ^ ]



编辑

---------

我是个白痴。



根据您的代码,您忘记取消注释/注释SetLogOnInfo行。

Check this
C# Crystal Reports Dynamic Logon parameters[^]

EDIT
---------
I'm an idiot.

Based on your code, you forgot to uncomment/comment the SetLogOnInfo lines.
'report.Database.Tables.Item(1).SetLogOnInfo "P:\Inventory\Test\", "Spawntestbe", "admin", ""
report.Database.Tables.Item(1).SetLogOnInfo "", "", "admin", ""



因为报告需要连接数据库文件,但在上面的未注释行中,这些字段是空。所以我认为你应该评论下面这一行&取消注释上面的行(具有数据库详细信息)。


Because report needs the database file to connect but in above uncommented line, those fields're empty. So I think you should comment the below line & uncomment the above line(which has db details).


这篇关于访问数据库2010的水晶报告 - 登录错误 - ADO连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆