About  Usage  ADOxtra  Common  Connection  Recordset  Field  Property

ADOxtra Connection object functions:

Opening/Closing functions:
Open(),
Close(),
 
Recordset returning functions:
Execute(),
OpenSchema(),
 
Asynchronous methods support functions:
Cancel(),
 
Transaction functions:
BeginTrans(),
CommitTrans(),
RollbackTrans()

ADOxtra Connection object properties:

Initialization properties:
ConnectionString,
ConnectionTimeout,
DefaultDatabase,
Provider
Attributes
CursorLocation
IsolationLevel
Mode
Properties collection
 
State information properties:
Errors collection,
State,
 
Version information properties:
Version

Connection.Open()

Syntax

bSuccess=Connection.Open(connectionString,userID,password,options)

Parameters

connectionString
Optional. String value that contains connection information. See the cnn.ConnectionString property for details on valid settings.
 
userID
Optional. String value that contains a user name to use when establishing the connection.
 
password
Optional. String value that contains a password to use when establishing the connection.
 
options
Optional. Integer value that determines how the connection will be established. It may be one of the folowing constants:
Constant Value Description
cnn.adAsyncConnect 16 Opens the connection asynchronously.
cnn.adConnectUnspecified -1 Default. Opens the connection synchronously.

Returns

Integer
True (1) if function completed successfully, false (0) otherwise

Description

Calls the Open() method of the wrapped ADODB.Connection object. Using the Open method on a Connection object establishes the physical connection to a data source. After this method successfully completes, the connection is live and you can issue commands against it and process the results.
Use cnn.adAsyncConnect option to connect asynchronousely. It is usefull when connecting over busy LAN to MS SQL server. In this case check cnn.state property to determine whether connection succeeded.

Connection.Close()

Syntax

bSuccess=Connection.Close()

Returns

Integer
True (1) if function completed successfully, false (0) otherwise

Description

Calls the Close() method of the wrapped ADODB.Connection object. Use the Close method to close a Connection to free any associated system resources. Closing an object does not remove it from memory; you can change its property settings and open it again later. To completely eliminate an object from memory, set the object variable to VOID after closing the object.

Connection.Execute()

Syntax

rst=Connection.Execute(commandText,recordsAffected,options)

Parameters

commandText
Optional. String value that contains the SQL statement, table name, stored procedure, or provider-specific text to execute.
 
recordsAffected
VOID. Does not supported in the current version. Set it to VOID if you have to specify options parameter
 
options
Optional. Integer value that that indicates how the provider should evaluate the commandText argument. It may be a bitmask of one or more of the folowing constants:
Constant Value Description
cnn.adAsyncExecute 16 Indicates that the command should execute asynchronously.
cnn.adAsyncFetch 32 Indicates that the remaining rows after the initial quantity specified in the cacheSize property should be retrieved asynchronously.
cnn.adAsyncFetchNonBlocking 64 Indicates that the main thread never blocks while retrieving. If the requested row has not been retrieved, the current row automatically moves to the end of the file.
cnn.adExecuteNoRecords 128 Indicates that the command text is a command or stored procedure that does not return rows (for example, a command that only inserts data). If any rows are retrieved, they are discarded and not returned.
cnn.adOptionUnspecified -1 Indicates that the command is unspecified.
Constant Value Description
adCmdUnspecified -1 Does not specify the command type argument.
adCmdText 1 Evaluates commandText parameter as a textual definition of a command or stored procedure call.
adCmdTable 2 Evaluates commandText parameter as a table name whose columns are all returned by an internally generated SQL query.
adCmdStoredProc 4 Evaluates commandText parameter as a stored procedure name.
adCmdUnknown 8 Default. Indicates that the type of command in the commandText parameter property is not known.

Returns

Object
new Recordset wrapper object that contains returned records if any.

Description

Calls the Execute() method of the wrapped ADODB.Connection object. Using the Execute method on a Connection object executes whatever query you pass to the method in the commandText argument on the specified connection. If the commandText argument specifies a row-returning query, any results that the execution generates are stored in a new Recordset object. If the command is not a row-returning query, the provider returns a closed Recordset object.
The returned Recordset object is always a read-only, forward-only cursor. If you need a Recordset object with more functionality, first create a Recordset object with the desired property settings, then use the Recordset object's Open method to execute the query and return the desired cursor type.
The contents of the commandText argument are specific to the provider and can be standard SQL syntax or any special command format that the provider supports.

Connection.OpenSchema()

Syntax

rstSchema=Connection.OpenSchema(queryType)

Parameters

queryType
Integer value that represents the type of schema query to run. It can be one of the following values.
Constant Value Description
cnn.adSchemaAsserts 0 Returns the assertions defined in the catalog that are owned by a given user.
cnn.adSchemaCatalogs 1 Returns the physical attributes associated with catalogs accessible from the DBMS.
cnn.adSchemaCharacterSets 2 Returns the character sets defined in the catalog that are accessible to a given user.
cnn.adSchemaCheckConstraints 5 Returns the check constraints defined in the catalog that are owned by a given user.
cnn.adSchemaCollations 3 Returns the character collations defined in the catalog that are accessible to a given user.
cnn.adSchemaColumnPrivileges 13 Returns the privileges on columns of tables defined in the catalog that are available to, or granted by, a given user.
cnn.adSchemaColumns 4 Returns the columns of tables (including views) defined in the catalog that are accessible to a given user.
cnn.adSchemaColumnsDomainUsage 11 Returns the columns defined in the catalog that are dependent on a domain defined in the catalog and owned by a given user.
cnn.adSchemaConstraintColumnUsage 6 Returns the columns used by referential constraints, unique constraints, check constraints, and assertions, defined in the catalog and owned by a given user.
cnn.adSchemaConstraintTableUsage 7 Returns the tables that are used by referential constraints, unique constraints, check constraints, and assertions defined in the catalog and owned by a given user.
cnn.adSchemaCubes 32 Returns information about the available cubes in a schema (or the catalog, if the provider does not support schemas).
cnn.adSchemaDBInfoKeywords 30 Returns a list of provider-specific keywords.
cnn.adSchemaDBInfoLiterals 31 Returns a list of provider-specific literals used in text commands.
cnn.adSchemaDimensions 33 Returns information about the dimensions in a given cube. It has one row for each dimension.
cnn.adSchemaForeignKeys 27 Returns the foreign key columns defined in the catalog by a given user.
cnn.adSchemaHierarchies 34 Returns information about the hierarchies available in a dimension.
cnn.adSchemaIndexes 12 Returns the indexes defined in the catalog that are owned by a given user.
cnn.adSchemaKeyColumnUsage 8 Returns the columns defined in the catalog that are constrained as keys by a given user.
cnn.adSchemaLevels 35 Returns information about the levels available in a dimension.
cnn.adSchemaMeasures 36 Returns information about the available measures.
cnn.adSchemaMembers 38 Returns information about the available members.
cnn.adSchemaPrimaryKeys 28 Returns the primary key columns defined in the catalog by a given user.
cnn.adSchemaProcedureColumns 29 Returns information about the columns of rowsets returned by procedures.
cnn.adSchemaProcedureParameters 26 Returns information about the parameters and return codes of procedures.
cnn.adSchemaProcedures 16 Returns the procedures defined in the catalog that are owned by a given user.
cnn.adSchemaProperties 37 Returns information about the available properties for each level of the dimension.
cnn.adSchemaProviderTypes 22 Returns the (base) data types supported by the data provider.
cnn.adSchemaReferentialConstraints 9 Returns the referential constraints defined in the catalog that are owned by a given user.
cnn.adSchemaSchemata 17 Returns the schemas (database objects) that are owned by a given user.
cnn.adSchemaSQLLanguages 18 Returns the conformance levels, options, and dialects supported by the SQL-implementation processing data defined in the catalog.
cnn.adSchemaStatistics 19 Returns the statistics defined in the catalog that are owned by a given user.
cnn.adSchemaTableConstraints 10 Returns the table constraints defined in the catalog that are owned by a given user.
cnn.adSchemaTablePrivileges 14 Returns the privileges on tables defined in the catalog that are available to, or granted by, a given user.
cnn.adSchemaTables 20 Returns the tables (including views) defined in the catalog that are accessible to a given user.
cnn.adSchemaTranslations 21 Returns the character translations defined in the catalog that are accessible to a given user.
cnn.adSchemaTrustees 39 Reserved for future use.
cnn.adSchemaUsagePrivileges 15 Returns the USAGE privileges on objects defined in the catalog that are available to, or granted by, a given user.
cnn.adSchemaViewColumnUsage 24 Returns the columns on which viewed tables, defined in the catalog and owned by a given user, are dependent.
cnn.adSchemaViews 23 Returns the views defined in the catalog that are accessible to a given user.
cnn.adSchemaViewTableUsage 25 Returns the tables on which viewed tables, defined in the catalog and owned by a given user, are dependent.

Returns

Object
new Recordset wrapper object that contains returned records.

Description

Calls the OpenSchema() method of the wrapped ADODB.Connection object. The OpenSchema method returns self-descriptive information about the data source, such as what tables are in the data source, the columns in the tables, and the data types supported.

Connection.Cancel()

Syntax

bSuccess=Connection.Cancel()

Returns

Integer
True (1) if function completed successfully, false (0) otherwise

Description

Calls the Cancel() method of the wrapped ADODB.Connection object. Use the Cancel method to terminate execution of an asynchronous method call (that is, a method invoked with the adAsyncConnect, adAsyncExecute, or adAsyncFetch option).

Connection.BeginTrans()

Syntax

nLevel=Connection.BeginTrans()

Returns

Integer
indicating the nesting level of the transaction.

Description

Calls the BeginTrans() method of the wrapped ADODB.Connection object. After you call the BeginTrans method, the provider will no longer instantaneously commit changes you make until you call CommitTrans or RollbackTrans to end the transaction.

Version

Not supported in Lite version

Connection.CommitTrans()

Syntax

bSuccess=Connection.CommitTrans()

Returns

Integer
True (1) if function completed successfully, false (0) otherwise

Description

Calls the CommitTrans() method of the wrapped ADODB.Connection object. Calling the CommitTrans method saves changes made within an open transaction on the connection and ends the transaction. Calling this method when there is no open transaction generates an error.

Version

Not supported in Lite version

Connection.RollbackTrans()

Syntax

bSuccess=Connection.RollbackTrans()

Returns

Integer
True (1) if function completed successfully, false (0) otherwise

Description

Calls the RollbackTrans() method of the wrapped ADODB.Connection object. Calling the RollbackTrans method reverses any changes made within an open transaction and ends the transaction. Calling this method when there is no open transaction generates an error.

Version

Not supported in Lite version

Connection.Errors

Syntax

strProviderErrors=Connection.Error
put Connection.Errors[i]
nProviderErrorsCount=Connection.Errors.Count

Returns

String
Provider error string

Description

Allows access to the Errors collection of the wrapped ADODB.Connection object. Any operation involving ADO objects can generate one or more provider errors. As each error occurs, one or more Error objects can be placed in the Errors collection of the Connection object. When another ADO operation generates an error, the Errors collection is cleared, and the new set of Error objects can be placed in the Errors collection.

Connection.State

Syntax

put Connection.State

Returns

Integer
The state of the connection object. It can be a bitmask of the following values:
Constant Value Description
cnn.adStateClosed 0 Indicates that the object is closed.
cnn.adStateOpen 1 Indicates that the object is open.
cnn.adStateConnecting 2 Indicates that the object is connecting.
cnn.adStateExecuting 4 Indicates that the object is executing a command.
cnn.adStateFetching 8 Indicates that the rows of the object are being retrieved.

Description

Returns the state property of the wrapped ADODB.Connection object. Indicates whether the state of the object is open or closed and asynchronous state as well.

Connection.ConnectionString

Syntax

Connection.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=demoDb.mdb"
put Connection.ConnectionString

Sets or Gets

String
The ConnectionString string

Description

Sets or gets the ConnectionString property of the wrapped ADODB.Connection object. Indicates the information used to establish a connection to a data source. The ConnectionString property is read/write when the connection is closed and read-only when it is open. Connection string is the string in form "PropertyName=PropertyValue;OtherPropertyName=OtherValue" that specify information necessary to connect to the database. Use BuildConnectionString xtra level method to invoke a dialog for building connection string.

Connection.Version

Syntax

put Connection.Version

Returns

String
The Version string

Description

Returns the Version property of the wrapped ADODB.Connection object. Use the Version property to return the version number of the ADO implementation.

Connection.ConnectionTimeout

Syntax

put Connection.ConnectionTimeout
Connection.ConnectionTimeout=30

Sets or gets

Integer
value that indicates, in seconds, how long to wait for the connection to open

Description

Sets or gets the ConnectionTimeout property of the wrapped ADODB.Connection object. Sets or returns a value that indicates, in seconds, how long to wait for the connection to open. The ConnectionTimeout property is read/write when the connection is closed and read-only when it is open.

Connection.DefaultDatabase

Syntax

put Connection.DefaultDatabase
Connection.DefaultDatabase="Pubs"

Sets or gets

String
value that evaluates to the name of a database available from the provider

Description

Sets or gets the DefaultDatabase property of the wrapped ADODB.Connection object. Use the DefaultDatabase property to set or return the name of the default database on a specific Connection object. If there is a default database, SQL strings may use an unqualified syntax to access objects in that database. To access objects in a database other than the one specified in the DefaultDatabase property, you must qualify object names with the desired database name. Upon connection, the provider will write default database information to the DefaultDatabase property. Some providers allow only one database per connection, in which case you cannot change the DefaultDatabase property. Some data sources and providers may not support this feature, and may return an error or an empty string.

Connection.Provider

Syntax

put Connection.Provider
Connection.Provider="Microsoft.Jet.OLEDB.3.51"

Sets or gets

String
value that indicates the provider name

Description

Sets or gets the Provider property of the wrapped ADODB.Connection object. Use the Provider property to set or return the name of the provider for a connection. The Provider property is read/write when the connection is closed and read-only when it is open.

Connection.Attributes

Syntax

put Connection.Attributes
Connection.Attributes=Connection.adXactAbortRetaining

Sets or gets

Integer
value that indicates transactions functions behaviour. It may be 0 or one or more of the following values:
Constant Value Description
cnn.adXactAbortRetaining 262144 Performs retaining aborts—that is, calling RollbackTrans automatically starts a new transaction. Not all providers support this.
cnn.adXactCommitRetaining 131072 Performs retaining commits—that is, calling CommitTrans automatically starts a new transaction. Not all providers support this.

Description

Sets or gets the Attributes property of the wrapped ADODB.Connection object. Use the Attributes property to set or return characteristics of Connection objects.
When you set multiple attributes, you can sum the appropriate constants. If you set the property value to a sum including incompatible constants, an error occurs.

Connection.CursorLocation

Syntax

put Connection.CursorLocation
Connection.CursorLocation=Connection.adUseServer

Sets or gets

Integer
value value that can be set to one of the following values:
Constant Value Description
cnn.adUseClient 3 Uses client-side cursors supplied by a local cursor library. Local cursor services often will allow many features that driver-supplied cursors may not, so using this setting may provide an advantage with respect to features that will be enabled. For backward compatibility, the synonym adUseClientBatch is also supported.
cnn.adUseServer 2 Default. Uses data-provider or driver-supplied cursors. These cursors are sometimes very flexible and allow for additional sensitivity to changes others make to the data source.

Description

Sets or gets the CursorLocation property of the wrapped ADODB.Connection object. This property allows you to choose between various cursor libraries accessible to the provider. Usually, you can choose between using a client-side cursor library or one that is located on the server.
This property setting affects connections established only after the property has been set. Changing the CursorLocation property has no effect on existing connections.

Connection.Mode

Syntax

put Connection.Mode
Connection.Mode=Connection.adModeReadWrite

Sets or gets

Integer
value value that indicates the access permissions in use by the provider on the current connection. It can be set to one or more of the following values:
Constant Value Description
adModeRead 1 Indicates read-only permissions.
adModeReadWrite 3 Indicates read/write permissions.
adModeShareDenyNone 16 Allows others to open a connection with any permissions. Neither read nor write access can be denied to others.
adModeShareDenyRead 4 Prevents others from opening a connection with read permissions.
adModeShareDenyWrite 8 Prevents others from opening a connection with write permissions.
adModeShareExclusive 12 Prevents others from opening a connection.
adModeUnknown 0 Default. Indicates that the permissions have not yet been set or cannot be determined.
adModeWrite 2 Indicates write-only permissions.

Description

Sets or gets the Mode property of the wrapped ADODB.Connection object. Use the Mode property to set or return the access permissions in use by the provider on the current connection. You can set the Mode property only when the Connection object is closed.
When used on a client-side Connection object, the Mode property can only be set to adModeUnknown.

Connection.IsolationLevel

Syntax

put Connection.IsolationLevel
Connection.IsolationLevel=Connection.adXactUnspecified

Sets or gets

Integer
value value that indicates the isolation level of a Connection object. It can be set to one of the following values:
Constant Value Description
adXactUnspecified -1 Indicates that the provider is using a different isolation level than specified, but that the level cannot be determined.
adXactChaos 16 Indicates that pending changes from more highly isolated transactions cannot be overwritten.
adXactBrowse 256 Indicates that from one transaction you can view uncommitted changes in other transactions.
adXactReadUncommitted 256 Same as adXactBrowse.
adXactCursorStability 4096 Indicates that from one transaction you can view changes in other transactions only after they have been committed.
adXactReadCommitted 4096 Same as adXactCursorStability.
adXactRepeatableRead 65536 Indicates that from one transaction you cannot see changes made in other transactions, but that requerying can retrieve new Recordset objects.
adXactIsolated 1048576 Indicates that transactions are conducted in isolation of other transactions.
adXactSerializable 1048576 Same as adXactIsolated.

Description

Sets or gets the Mode property of the wrapped ADODB.Connection object. Use the Mode property to set or return the access permissions in use by the provider on the current connection. You can set the Mode property only when the Connection object is closed.
When used on a client-side Connection object, the Mode property can only be set to adModeUnknown.

Connection.Properties[ ]

Syntax

val=Connection.Properties[propertyIndex]
Connection.Properties[propertyIndex]=newVal
propertiesCount=Connection.Properties.Count

Parameters

propertyIndex
String property name or Integer zero based index of the property object in Connection.Properties collection

Sets or gets

Any
connection property value

Description

Allows access to the Value property of the property objects in Properties collection of the wrapped ADODB.Connection object. Each Property object corresponds to a characteristic of the ADODB.Connection object specific to the provider.

Example

  on ShowProperties ref
    repeat with i= 0 to ref.Properties.Count - 1
      put ref.Properties[i].Name & "=" &   ref.Properties[i]
    end repeat
  end

Connection.Properties[ ].propName

Syntax

objADOProperty=Connection.Properties[propertyIndex].ref
propertyName=objADOProperty.Name
val=objADOProperty.Value
objADOProperty.Value=newVal
 
propertiesCount=Connection.Properties.Count
propertyName=Connection.Properties[propertyIndex].Name
propertyType=Connection.Properties[propertyIndex].Type
propertyValue=Connection.Properties[propertyIndex].Value
propertyAttributes=Connection.Properties[propertyIndex].Attributes

Example

  on ShowProperties ref
    repeat with i= 0 to ref.Properties.Count - 1
      put ref.Properties[i].Name & "=" &   ref.Properties[i]
    end repeat
  end

Parameters

propertyIndex
String property name or Integer zero based index of the property object in Connection.Properties collection

Returns

Object
wrapper for the corresponding ADODB.Property object

Description

Allows access to the Property objects of the Properties collection of the wrapped ADODB.Connection object. Each Property object corresponds to a characteristic of the ADODB.Connection object specific to the provider.

©2001 Eugene Shoustrov www.adoxtra.com Built on March 28, 2001