在Crystal Reports中提示进行Sql身份验证 [英] Prompt for Sql authentication in Crystal Reports

查看:119
本文介绍了在Crystal Reports中提示进行Sql身份验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL 2005作为需要身份验证的数据库服务器.
当我尝试在客户端浏览器中打开Crystal报表时,它会提示并询问sql数据库的用户名和密码.我已经在CrystalReport数据库专家"窗口中填写了这些信息.我不希望客户端中出现此身份验证提示.
我应该如何防止呢?

I am using SQL 2005 as the database server which required authentication.
When i tried to open a crystal report in a client browser it prompts and asks for user name and password of the sql database. I have already filled these information in the CrystalReport "database expert" windows. I don''t want this authentication prompt in the client.
How should I prevent this?

推荐答案

我在前一段时间使用的程序中遇到了同样的麻烦,但是我使用的是Access数据库.我已经设计了一个数据库用于打印,但是从未计划过使用它来将数据放入数据库中.就是这样,我可以设计一个报表,然后在程序中创建一个与数据库设计匹配的内存数据集,并将其传递给Crystal报表.问题似乎归结为这样一个事实,即程序期望运行它的计算机在设计该数据库时将其数据库放置在与我的计算机相同的位置.因此,我要做的是将该设计数据库包括在部署中,然后在代码中将ReportDocument对象指向它在用户计算机上的放置位置.像这样的东西:
I had this same trouble in a program that I worked on a while back, but I use an Access database. I had designed a database to use for printing but never actually planned to use it to put data into it. It was just so I could design a report, and then in the program I would create an in-memory dataset that matched the database design and pass it to the crystal report. The problem seemed to come down to the fact that the program is expecting the machine it''s running on to have that database in the same location as my computer when I designed it. So what I had to do was include that design database as part of my deployment and then in code point the ReportDocument object to where it would be located on the users machine. Something like this:
Dim strSchemaPath As String = My.Computer.FileSystem.SpecialDirectories.CurrentUserApplicationData & System.IO.Path.DirectorySeparatorChar & "MySchemaDatabase.mdb"
Dim cdReportDocument As New CrystalDecisions.CrystalReports.Engine.ReportDocument
cdReportDocument.DataSourceConnections.Item(0).SetConnection(strSchemaPath, "", False)
cdReportDocument.SetDataSource(dsMyDataSet)



我觉得必须有一种更好的方法来解决此问题,但是在搜索了很长时间之后却一无所获之后,我才解决了这个问题.如果它不适用于SQL 2005或您的特定程序要求,希望这至少可以帮助您继续搜索.



I have a feeling there must be a better way to get around this issue, but after searching for quite a while and finding nothing I just went with this. Hopefully this will at least help you continue your search if it doesn''t work for SQL 2005 or for your specific program requirements.


这篇关于在Crystal Reports中提示进行Sql身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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