Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
191
Добавлен:
11.05.2015
Размер:
4.96 Mб
Скачать

Database Object Methods

LogOffServer Method (Database Object), Page 31

LogOnServer Method (Database Object), Page 32

SetDataSource Method (Database Object), Page 33

Verify Method (Database Object), Page 33

LogOffServer Method (Database Object)

The LogOffServer method logs off and SQL server or ODBC data source. Use this method when you have logged on to the data source using SetDataSource Method (Database Object), Page 33. This method can be invoked only in formatting Idle mode.

Syntax

[form]Object.logOffServer pDllName, pServerName[, pDatabaseName ][, pUserID ][, pPassword ]

Parameters

Parameter

Type

 

 

 

 

DLLName

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.

ServerName

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.

 

 

DatabaseName

Specifies the name for the database used to create the report.*

(Optional)

 

UserID (Optional)

Specifies the User ID number necessary to log on to the server.*

 

 

Password (Optional)

Specifies the password necessary to log on to the server.

 

 

*When 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 (i.e., "Server A").Description.

Report Designer Component Object Model

31

Remarks

If you try to log off a server that is still in use (i.e., there is an object variable still in focus that holds reference to a report that requires being logged on to the server to access data) you will be unable to log off. This will apply to every object that comes from the Report Object (page 93), as they all hold reference to the report through their respective Report properties.

If you assign the Report object to the ReportSource property of the CRViewer Object (page 143), in the Seagate Crystal Reports Smart Viewer, enabling the report to be displayed through the Smart Viewer, you can not call LogOffServer for the report until you assign a new report to the Smart Viewer or close the CRViewer object.

LogOnServer Method (Database Object)

The LogOnServer method logs on to an SQL server or ODBC data source. Once logged on using this method, you will remain logged on until you call LogOffServer or until the Database Object is destroyed. This method can be invoked only in formatting Idle mode.

Syntax

[form]Object.logOnServer pDllName, pServerName[, pDatabaseName ][, pUserID ][, pPassword ]

Parameters

Parameter

Type

 

 

 

 

DLLName

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.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.

 

 

ServerName

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.

 

 

DatabaseName

Specifies the name for the database used to create the report.*

(Optional)

 

 

 

UserID (Optional)

Specifies the User ID number necessary to log on to the server.*

Password (Optional)

Specifies the password necessary to log on to the server.

 

 

*When 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 (i.e., "Server A").Description.

Report Designer Component Object Model

32

Соседние файлы в папке crystal