将 SQL 密码嵌入到 Crystal Reports RPT 文件中? [英] Embed SQL Password into Crystal Reports RPT file?

查看:17
本文介绍了将 SQL 密码嵌入到 Crystal Reports RPT 文件中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在试验这样的 Crystal Reports 查看器:

We are experimenting with Crystal Reports viewers such as this one:

http://www.thereportviewer.com/

...实际上可以重新连接到数据源并使用实时数据重新运行 Crystal Reports RPT 文件.

... which can actually re-connect to the data source and re-run a Crystal Reports RPT file with live data.

但是,在运行报表时,查看器会要求输入密码以连接到数据源(在本例中为 SQL Server).

However when running the report the viewer asks for a password to connect to the data source (in this case SQL Server).

Crystal Reports 是否有某种方法可以将连接密码嵌入到 RPT 文件中以避免这种情况?或者我应该使用控制面板/ODBC 中的系统 DSN 来解决这个问题?

Does Crystal Reports have some way of embedding a connection password into a RPT file to avoid this? Or should I be using a System DSN from the Control Panel/ODBC thing to get around this?

我认为其他人一定遇到过这个问题.

I figure someone else must have had this problem.

推荐答案

你不能那样做.如果可能,在 DSN 中设置密码或使用可以为您存储密码的报告查看器.当然,您也可以构建自己的 .NET 报告查看器,如果您有 .NET 知识,这并不难.

You can't do that. If possible set the password in the DSN or use a Report Viewer that can store the passwords for you. You can of course also build your own .NET report viewer, which isn't very hard to do if you've got .NET knowledge.

2010 年 4 月 29 日添加:

Added on April 29, 2010:

您可以尝试执行以下操作:通过 Crystal Reports 中的创建连接"连接到ODBC (RDO)".在对话框的底部,您会找到一个用于输入连接字符串的选项.连接字符串可以包含登录信息,如下例所示.

What you can try is doing the following: Connect to a "ODBC (RDO)" via "Create Connection" in Crystal Reports. At the bottom of the dialog you'll find an option to enter a connection string. A connection string can contain the login info, like the example below.

示例连接字符串:DSN=;DB=;UID=;PWD=密码

Example connection string: DSN=;DB=;UID=;PWD=password

这篇关于将 SQL 密码嵌入到 Crystal Reports RPT 文件中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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