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

Property

Description

Read/Write

Restriction in

event handler

 

 

 

 

 

 

 

 

 

 

 

DllName

Returns the table driver DLL name.

Read only

None

 

 

 

 

Fields

Returns DatabaseFieldDefinitions Collection,

Read only

None

 

Page 36, specifying a collection of database

 

 

 

fields in the table.

 

 

 

 

 

 

Location

Gets/sets the location of the database table.

Read/Write

Can be written

 

 

 

only when

 

 

 

formatting idle.

 

 

 

 

LogOnDatabase

Returns the logon database name.

Read only

None

Name

 

 

 

 

 

 

 

LogOnServerName

Returns the logon server name.

Read only

None

LogOnUserID

Returns the logon user ID.

Read only

None

Name

Returns/Sets the alias name for the database

Read/Write

Can be written

 

table used in the report.

 

only when

 

 

 

formatting idle.

 

 

 

 

Parent

Reference to the Parent object (Database

Read only

None

 

Object (page 30)).

 

 

 

 

 

 

SessionUserID

Returns the session user ID.

Read only

None

 

 

 

 

DatabaseTable Object Methods

SetDataSource Method (DatabaseTable Object), Page 37

SetLogOnInfo Method (DatabaseTable Object), Page 38

SetPrivateData Method (Database Table Object), Page 38

SetSessionInfo Method (Database Table Object), Page 39

TestConnectivity Method (Database Table Object), Page 40

SetDataSource Method (DatabaseTable Object)

The SetDataSource 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 using the Crystal Active Data Driver 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.

Syntax

object.SetPrivateData DataTag, Data

Report Designer Component Object Model

37

Parameters

Parameter

Description

 

 

 

 

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.

 

 

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.

 

 

SetLogOnInfo Method (DatabaseTable Object)

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

Syntax

object.SetLogOnInfo DllName, ServerName, _DatabaseName, UserID, Password

Parameters

Parameter

Description

 

 

 

 

ServerName

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

 

located (i.e., 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 Method (Database Table Object)

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 using the Crystal Active Data Driver 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.

Syntax

object.SetPrivateData DataTag, Data

Report Designer Component Object Model

38

Parameters

Parameter

Description

 

 

 

 

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.

 

 

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.

 

 

SetSessionInfo Method (Database Table Object)

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

Syntax

object.SetSessionInfo SessionUserID As String, SessionPassword As String

Parameters

Parameter

Description

 

 

 

 

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 known 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 Method (DatabaseTable Object), Page 38.

Report Designer Component Object Model

39

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