我用VB+SQL+水晶报表做的一个打印程序,数据库连接是存在报表文件中的,起初使用正常,可是在修改SQLSERVER登陆密码后,每次调用打印都提示我输入数据库连接的密码,请教各位大侠如何在水晶报表9中重设数据库当前连接的密码?

解决方案 »

  1.   


    Crystol Report有一个ConnectionInfo类。设置当前报表实例对象的ConnectionInfo就行了。
      

  2.   

    设置当前报表实例对象的ConnectionInfo。
      

  3.   

    The LogOnServer method logs on to an SQL server, ODBC or other data source. Once logged on using this method, you will remain logged on until you call LogOffServer or until the Application Object is destroyed and craxdrt.dll is unloaded. This method can be invoked only in formatting Idle mode.SyntaxSub LogOnServer (pDllName As String, pServerName As String,
        [pDatabaseName], [pUserID], [pPassword])Parameters Parameter Description
    pDllName Specifies the name of the DLL for the server or password protected non-SQL table you want to log on to, for example "PDSODBC.DLL". Note that the dllName must be enclosed in quotes. DLL names have the following naming convention: PDB*.DLL for standard (non-SQL) databases, PDS*.DLL for SQL/ODBC databases.
    pServerName Specifies the log on name for the server used to create the report. For ODBC, use the data source name. This value is case-sensitive. See Res below.
    [pDatabaseName] Specifies the name for the database used to create the report. See Res below.
    [pUserID] Specifies the User ID number necessary to log on to the server. See Res below.
    [pPassword] Specifies the password necessary to log on to the server.
     ResWhen you pass an empty string ("") for this parameter, the program uses the value that's already set in the report. If you want to override a value that's already set in the report, use a non-empty string (for example, "Server A").