Initialization Properties

Advantage OLE DB Provider (for ADO)

  Previous topic Next topic  

 

The Advantage OLE DB Provider implements the following properties in the DBPROPSET_DBINIT property set. All of these properties are in the Initialization property group.

Property ID

Description

DBPROP_AUTH_PASSWORD

Type: VT_BSTR

Typical R/W: Read/Write

Description: Password

Indicates the password to use in conjunction with the User ID (DBPROP_AUTH_USERID) when making a Database Connection to an Advantage server.

DBPROP_AUTH_USERID

Type: VT_BSTR

Typical R/W: Read/Write

Description: User ID

Indicates the user name to use when making a Database Connection to an Advantage server (see DBPROP_INIT_DATASOURCE). Note that if this property is supplied, Advantage assumes that a Database Connection is being attempted. If a Free Connection is desired, do not supply this property.

DBPROP_INIT_CATALOG

Type: VT_BSTR

Typical R/W: Read/Write

Description: Initial Catalog

The name of the data dictionary to use when creating a Database Connection to an Advantage server. It is not necessary to specify the initial catalog. The full path to the Advantage Data Dictionary can also be specified in the Data Source (DBPROP_INIT_DATASOURCE) property if desired.

DBPROP_INIT_DATASOURCE

Type: VT_BSTR

Typical R/W: Read/Write

Description: Data Source

The fully qualified path to the computer where the data files exist and the default location of the data files. This fully qualified path must contain a drive letter or use UNC. The Data Source must be specified before a successful connection to an Advantage server can occur. If a Free Connection is desired, the Data Source must specify a directory location. For a Database Connection, the path and data dictionary file can be specified in the Data Source property (e.g., Data Source=\\myserver\myvolume\mypat\mydd.add). Or the Data Source can contain just the path, and the Initial Catalog property (DBPROP_INIT_CATALOG) can contain the data dictionary name (e.g., Data Source=\\myserver\myvolume\mypath; Initial Catalog=mydd.add).

DBPROP_INIT_HWND

Type: VT_I4

Typical R/W: Read/Write

Description: Window Handle

Indicates the window handle to be used if the data source object needs to prompt for additional information. Currently, the Advantage OLE DB Provider will never prompt the consumer for additional information.

DBPROP_INIT_MODE

Type: VT_I4

Typical R/W: Read/Write

Description: Mode

A bitmask specifying access permissions. For the Advantage OLE DB Provider, the default value is DB_MODE_READWRITE | DB_MODE_SHARE_DENY_NONE.

If you are accessing a database on read-only media such as a CD-ROM, then you should set the DBPROP_INIT_MODE entry to DB_MODE_READ (ADODB.Mode = adModeRead in ADO), so that Advantage will not attempt to open the tables in read-write mode. Note that setting the mode to DB_MODE_READ does not affect UPDATE, INSERT, and DELETE statements. Those statements can still be executed on this connection.

DBPROP_INIT_PROMPT

Type: VT_I2

Typical R/W: Read/Write

Description: Prompt

Indicates whether to prompt the user during initialization. The Advantage OLE DB Provider supports all prompting modes for data source initialization. The Advantage OLE DB Provider uses DBPROMPT_NOPROMPT as its default setting for the property.

DBPROP_INIT_PROVIDERSTRING

Type: VT_BSTR

Typical R/W: Read/Write

Description: Extended Properties

A string containing provider-specific, extended connection information. See the Advantage OLE DB Provider String later in this topic for more information on valid Provider String values.

DBPROP_INIT_TIMEOUT

Type: VT_I4

Typical R/W: Read/Write

Description: Connect Timeout

Indicates the amount of time (in seconds) to wait for initialization to complete. The Advantage OLE DB Provider ignores this timeout setting.

The Advantage OLE DB Provider String

The Advantage OLE DB Provider recognizes an ODBC-like syntax in provider string property values. The provider string property is provided as the value of the OLE DB initialization property DBPROP_INIT_PROVIDERSTRING when a connection is established to the OLE DB data source. This property specifies OLE DB provider-specific connection data required to implement a connection to the OLE DB data source. Within the string, elements are delimited by using a semicolon. The final element in the string must be terminated with a semicolon. Each element consists of a keyword, an equal sign character, and the value passed on initialization, as shown in the following example:

 

TableType=ADX_CDX;SecurityMode=ADS_IGNORERIGHTS;

 

With the Advantage OLE DB Provider, the consumer never needs to use the provider string property. The consumer can set any initialization property reflected in the provider string by using either OLE DB–specific or the Advantage OLE DB Provider-specific initialization properties.

The Advantage OLE DB Provider recognizes the following keywords in the provider string property.

Property ID

Description

ADSPROP_INIT_CHAR_TYPE

Keyword: CharType

Description: Specifies whether the data in DBF tables is ANSI or OEM. Valid values include ADS_ANSI and ADS_OEM. This setting is applicable to the ADS_CDX, ADS_VFP, and ADS_NTX TableType options. The default is ADS_ANSI. When using ADS_ADT and ADS_VFP tables, the value can also be one of the dynamically loaded collations.

ADSPROP_INIT_ENCRYPTION_PASSWORD

Keyword: EncryptionPassword

Description: Specifies the encryption password to use with all tables on Free Connections. The encryption password will consist of the first twenty characters specified. For Database Connections (see DBPROP_INIT_DATASOURCE), this property is not used. Database Connections should use the User ID and Password properties (DBPROP_AUTH_USERID and DBPROP_AUTH_PASSWORD).

ADSPROP_INIT_FILTER_OPTIONS

Keyword: FilterOptions

Description: Specifies whether to respect the filtering applied to the rowset when determining record count and logical positioning information. Valid values are IGNORE_WHEN_COUNTING and RESPECT_WHEN_COUNTING. When using RESPECT_WHEN_COUNTING, the record count and scroll bar positioning will be accurate but with a potential speed tradeoff. In some cases, the provider may have to skip through all records in the rowset to determine the count and position. It is not recommended to use this option except on very small rowsets. When a rowset is to be opened and displayed in a data bound grid, the grid requests record count information from the provider to position the scroll bar. Because it can request this information several times for any movement in the grid, it is usually best if the IGNORE_WHEN_COUNTING option is used in order for the grid to be more responsive. If you use the ADO RecordSet property .RecordCount and need a completely accurate count, then use the RESPECT_WHEN_COUNTING option. All record count requests are sent to the same OLE DB interface, so it is not possible for it to know implicitly how accurate the count should be for a given call. The default is IGNORE_WHEN_COUNTING.

ADSPROP_INIT_INCREMENT_USERCOUNT

Keyword: IncrementUsercount

Description: Specifies whether to increment the user count on the Advantage Database Server even if the current PC is already connected. Valid values are TRUE and FALSE. With a value of FALSE, if the same PC connects to Advantage more than one time the connections are counted as a single user and only the connection count is incremented. With a value of TRUE, each connection counts as a new user on the Advantage Database Server. This property allows an Advantage middleware type of application to increment the Advantage Database Server user count for each remote client workstation indirectly accessing the Advantage Database Server. This provides an easy way for Advantage middleware applications to abide by the Advantage Database Server license agreement as related to remote client workstations taking up a "user" toward the maximum number of licensed users. The default is FALSE.

ADSPROP_INIT_LOCK_MODE

Keyword: LockMode

Description: Specifies the locking mode to use with DBF tables. Valid values include ADS_PROPRIETARY_LOCKING and ADS_COMPATIBLE_LOCKING. This setting is applicable to the ADS_CDX, ADS_VFP, and ADS_NTX TableType options. If set to ADS_PROPRIETARY_LOCKING, Advantage’s high-performance internal locking mode is used. If set to ADS_COMPATIBLE_LOCKING, DBF tables can be shared in a writable mode with non-Advantage database applications. The default is ADS_PROPRIETARY_LOCKING.

ADSPROP_INIT_SECURITY_MODE

Keyword: SecurityMode

Description: Specifies the security mode to use. Valid values include ADS_CHECKRIGHTS and ADS_IGNORERIGHTS. The default is ADS_CHECKRIGHTS.

Beginning with version 10.0, the client no longer performs rights checking by default. See Check Rights.

ADSPROP_INIT_SERVER_TYPE

Keyword: ServerType

Description: Specifies the Advantage server types to which connections should be attempted. Valid values include ADS_REMOTE_SERVER, ADS_AIS_SERVER, and ADS_LOCAL_SERVER. These values can be logically ORed together with the vertical bar character "|" in order to choose multiple server types. The default is ADS_REMOTE_SERVER | ADS_AIS_SERVER. If multiple types are specified and multiple server types are available, the order of precedence is ADS_REMOTE_SERVER first, ADS_AIS_SERVER second, and ADS_LOCAL_SERVER third.

ADSPROP_INIT_SHOW_DELETED

Keyword: ShowDeleted

Description: Specifies whether deleted records in DBF tables are visible. Valid values are TRUE or FALSE. This setting is applicable to the ADS_CDX, ADS_VFP and ADS_NTX TableType options. If set to TRUE, deleted records in the DBF table will be visible. The default is FALSE.

ADSPROP_INIT_TABLE_TYPE

Keyword: TableType

Description: Specifies the desired table type. Valid values include ADS_ADT, ADS_CDX, ADS_VFP, and ADS_NTX. The default is ADS_ADT.

ADSPROP_INIT_TRIM_TRAILING_SPACES

Keyword: TrimTrailingSpaces

Description: Specifies whether trailing white space is removed from string fields when the data is retrieved. Valid values are TRUE or FALSE. If TRUE is specified, then fields of type DBTYPE_STR will have trailing white spaced trimmed on retrieval. Note that the Advantage data types ADS_STRING and ADS_MEMO are both mapped to DBTYPE_STR. If FALSE is specified, then trailing white space is maintained on the values when they are retrieved. This means that a fixed length field (ADS_STRING) with a width of 10, for example, will always return 10 characters when the value is retrieved; it is padded with as many spaces as necessary. It may be desirable to specify TRUE to trim trailing blanks if, for example, an application is using the ADO Find method. If trailing blanks are not trimmed, then search values given to the Find method would have to be padded to the full field length in order for the search to succeed. The default is FALSE.

ADSPROP_INIT_USE_NULLS

Keyword: DbfsUseNulls

Description: Specifies whether DBF tables are to return NULL for column data that is ordinarily considered as "empty" in Xbase terminology. Valid values are TRUE or FALSE. This setting is applicable to the ADS_CDX and ADS_NTX TableType options. If set to TRUE, "empty" column values in DBF tables will be returned as NULL. If set to FALSE, "empty" column values in DBF tables will be returned as actual valid data. The default is FALSE. This does not apply to ADS_VFP tables, which have true NULL value support.

ADSPROP_INIT_STORED_PROCEDURE_CONNECTION

 

Keyword: StoredProcedureConnection

Description: Specifies if this connection lives within a stored procedure executed on the behalf of remote clients. Valid values are TRUE and FALSE. If this property is set to TRUE, the application will not increment the server user count for the stored procedure. If it is FALSE, then the stored procedure will increment the server user count, which will prevent other users from connecting when the user count reaches the maximum. The default is FALSE. Connections to Advantage Local Server are not affected by this property.

ADSPROP_INIT_COMPRESSION

Keyword: Compression

Description: Specifies the option for communications compression. Valid values are INTERNET, ALWAYS, and NEVER. If INTERNET is specified, then all data communications for ADS_AIS_SERVER connections will be compressed unless compression is specifically turned off at the server. If ALWAYS is specified, then all data communications between the client and server will be compressed unless compression is specifically turned off at the server. If NEVER is specified, then compression will not be used for communications between the client and server. If this property is not specified, then the COMPRESSION setting in the ADS.INI file will be used if available. This property is ignored for ADS_LOCAL_SERVER connections.