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

Property

Description

Read/Write

 

 

 

 

 

 

PrivateDataTag

This property contains information about the type of data

Read only

 

accessed by the database driver. This value is used by the

 

 

database driver for the data source and should not be used in

 

 

your application. If your report has been designed by using

 

 

the crystal active data driver (see Active Data Driver, Volume

 

 

1, Chapter 5), the PrivateDataTag property will contain a

 

 

value of 3, once an active data source has been assigned to

 

 

the report. This value is associated with GetPrivateData

 

 

(page 306), and SetPrivateData (page 307), methods.

 

 

 

 

Report

Reference to Report Object (page 349).

Read only

SessionUserID

Returns the user ID used for Access session security. Returns

Read only

 

the user ID used to create the report, or the user ID passed to

 

 

the SetSessionInfo (page 308), method if an Access session

 

 

has been opened.

 

Type

Returns value of type CRDatabaseType (see table below)

Read only

 

indicating the type of database (that is, standard or SQL).

 

 

 

 

 

 

 

 

Constant

Value

 

 

 

 

 

 

 

crSQLDatabase

2

 

 

 

 

crStandardDatabase

1

 

 

 

DatabaseTable Object Methods

GetPrivateData

The GetPrivateData method is used to retrieve the current private data for a given table. The private data will be returned as the type specified in the VariantType parameter. The format of the private data is specific to each database driver.

For example, if the report has been designed by using the crystal active data driver, see Active Data Driver, Volume 1, Chapter 5. GetPrivateData can be used to obtain the active data object assigned to the report by using

SetPrivateData, Page 307.

Syntax

object.GetPrivateData VariantType

Crystal Report Engine Object Model for the Automation Server

306

Parameters

VariantType

A constant value indicating the type of data being retrieved. Use a Visual Basic

 

VarType constant value. For example, vbDataObject will return an Active Data

 

Object such as a DAO Recordset.

 

 

Returns

Variant.

SetLogOnInfo

The SetLogOnInfo method logs on to the data source so table data can be accessed.

Syntax

object.SetLogOnInfo DllName, ServerName, _ DatabaseName, UserID, Password

Parameters

DllName

Specifies the DLL used to access the database by the Crystal Report Engine

 

(that is, PDSODBC.DLL).

ServerName

Specifies the name of the server or ODBC data source where the database is

 

located (that is, CRSS).

 

 

DatabaseName

Specifies the name of the database.

(Optional)

 

UserID (Optional)

Specifies a valid user name for logging on to the data source.

 

 

Password (Optional)

Specifies a valid password for logging on to the data source.

 

 

SetPrivateData

The SetPrivateData method is used to provide information about a data source to the database driver associated with this DatabaseTable object. For instance, if a report has been designed by using the crystal active data driver (see Active Data Driver, Volume 1, Chapter 5), this method can be used to provide an active data source for the report, such as a DAO, ADO, or RDO Recordset or a CDO Rowset. In this case, the object passed to the second parameter of this method replaces, at runtime, the field definition file used to create the report. For complete information, see Using the Active Data Driver, Volume 1, Chapter 5.

Crystal Report Engine Object Model for the Automation Server

307

Syntax

object.SetPrivateData DataTag, Data

Parameters

DataTag

A value indicating the type of data being passed to the DatabaseTable object in the Data

 

parameter. Currently, the only possible value is 3. This value must be used for all Active

 

data sources including DAO, ADO, RDO, CDO, and the Visual Basic data control.

 

 

Data

Variant data passed to the database driver. For example, with Active data, this must be a

 

Recordset object if you are using DAO, ADO, or the Visual Basic data control. This must be

 

a Rowset object if you are using CDO.

SetSessionInfo

The SetSessionInfo method allows the user to log on to a secured Access session.

Syntax

object.SetSessionInfo SessionUserID As String, _ SessionPassword As String

Parameters

SessionUserID

Specifies the Access userID used to log on to an Access session.

 

 

SessionPassword

Specifies the session password for Access secured session.

 

 

Remarks

In Microsoft Access 95 and later, an Access database can have session security (also know as user-level security), database-level security, or both. If the Access database contains only session security, simply pass the session password to the SessionPassword parameter. If the Access database contains database-level security, use a linefeed character, Chr(10), followed by the database-level password. For example:

object.SetSessionInfo “userID”, Chr(10) & “dbpassword”

If the Access database contains both session security and database-level security, use the session password followed by the linefeed character and the database password:

object.SetSessionInfo “userID”, “sesspswd” & _ Chr(10) & “dbpassword”

Alternately, database-level security can also be handled by assigning the database-level password to the Password parameter of the SetLogOnInfo, Page 307, method.

Crystal Report Engine Object Model for the Automation Server

308

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