LogOnInfo specifies the information required to log on to one or more SQL servers or password-protected databases.
Syntax
[form.]Report.LogOnInfo(ArrayIndex)[ = Name;UserID;Password;DatabaseQualifier$]
For example:
CrystalReport1.LogOnInfo[0] = "DSN = Accounting;UID = 734;PWD = bigboard;DSQ = Administration"
«Connects to the "Administration" database on the "Accounting" server using the user ID #734 and the password "bigboard".»
CrystalReport1.LogOnInfo[0] = dsn=;uid=;pwd=bigboard;dsq=?
«Connects to a password-protected Paradox database. All that is being passed is the password bigboard.»
Remarks
l Use the LogOnInfo property when the report connects to multiple data sources that require different log on information. If the report connects to only a single ODBC data source or SQL server, and only a single set of log on information is required, simply pass 0 as the array index, or Connect, can be used instead.
l Use a separate line of code for each table for which you want to change the logon info.
l The order of tables in the array must conform to the order of tables in the report. (You can use the Database|Set Location command to determine the order of tables in the report.)
l The first table in the report is array index (0), the second file is (1), etc. For example, to change the logon information of the first and third tables in a report to the NEW server, use the following syntax:
CrystalReport1.LogOnInfo(0) = "DSN = NEW;UID = 734;PWD = bigboard;DSQ = Administration1"CrystalReport1.LogOnInfo(2) = "DSN = NEW;UID = 734;PWD = bigboard;DSQ = Administration2"
l LogOnInfo is an array property that is available at runtime only.
l Enter the parameters necessary to log on to each SQL server table that you need to change information for in your report. Parameters should be in the following format:
DSN = name;UID = userID;PWD = password;DSQ = database qualifier
¾ name is the server name,
¾ userID is the name you have been assigned for logging on to the SQL server,
¾ password is the password you have been assigned for logging on to the SQL server, and
¾ database qualifier is the database name if your server uses the database concept.
l The database qualifier parameter (DSQ) is required only when it is applicable to the ODBC/SQL driver you are using. If your DBMS does not use the database concept, you do not need to specify the DSQ parameter.
l Before you can use this property for an ODBC/SQL database, you must install the ODBC/SQL driver for whatever SQL database you are planning to use, and put the Database/BIN location in your path.
l If you are connecting to an SQL or other password protected database directly, without going through ODBC, use the name of the SQL server for the DSN parameter.
l RetrieveLogonInfo, can be used to populate this property with log on information automatically.
NOTE: If you are currently using the VBX control in your application, you will not be able to print individual subreports.
Data Type
Array of strings
Availability
Runtime
Partager