bSuccess=Connection.Open(connectionString,userID,password,options)connectionStringString value that contains connection information.
See the cnn.ConnectionString property
for details on valid settings. userIDpasswordoptions| Constant | Value | Description |
|---|---|---|
cnn.adAsyncConnect |
16 | Opens the connection asynchronously. |
cnn.adConnectUnspecified |
-1 | Default. Opens the connection synchronously. |
IntegerTrue (1) if function completed successfully, false
(0) otherwiseOpen() 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.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.bSuccess=Connection.Close()IntegerTrue (1) if function completed successfully, false
(0) otherwiseClose() 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. rst=Connection.Execute(commandText,recordsAffected,options)commandTextString value that contains the SQL statement, table
name, stored procedure, or provider-specific text to execute.recordsAffectedoptions parameteroptionscommandText 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. |
ObjectRecordset wrapper object that contains returned
records if any.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.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.commandText argument are specific to the
provider and can be standard SQL syntax or any special command format that
the provider supports.rstSchema=Connection.OpenSchema(queryType)queryTypeInteger 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. |
ObjectRecordset wrapper object that contains returned
records.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.bSuccess=Connection.Cancel()IntegerTrue (1) if function completed successfully, false
(0) otherwiseCancel() 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).nLevel=Connection.BeginTrans()IntegerBeginTrans() 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.bSuccess=Connection.CommitTrans()IntegerTrue (1) if function completed successfully, false
(0) otherwiseCommitTrans() 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.bSuccess=Connection.RollbackTrans()IntegerTrue (1) if function completed successfully, false
(0) otherwiseRollbackTrans() 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. strProviderErrors=Connection.Errorput Connection.Errors[i]nProviderErrorsCount=Connection.Errors.CountStringErrors 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. put Connection.StateInteger| 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. |
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="DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=demoDb.mdb"put Connection.ConnectionStringStringConnectionString stringConnectionString 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.put Connection.VersionStringVersion stringVersion property of the wrapped ADODB.Connection
object. Use the Version property to return the version number
of the ADO implementation. put Connection.ConnectionTimeoutConnection.ConnectionTimeout=30IntegerConnectionTimeout 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. put Connection.DefaultDatabaseConnection.DefaultDatabase="Pubs"StringDefaultDatabase 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. put Connection.ProviderConnection.Provider="Microsoft.Jet.OLEDB.3.51"StringProvider 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.put Connection.AttributesConnection.Attributes=Connection.adXactAbortRetainingInteger| 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. |
Attributes property of the wrapped ADODB.Connection
object. Use the Attributes property to set or return characteristics of Connection
objects. put Connection.CursorLocationConnection.CursorLocation=Connection.adUseServerInteger| 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. |
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.put Connection.ModeConnection.Mode=Connection.adModeReadWriteInteger| 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. |
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.Connection object, the Mode property
can only be set to adModeUnknown. put Connection.IsolationLevelConnection.IsolationLevel=Connection.adXactUnspecifiedInteger| 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. |
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.Connection object, the Mode property
can only be set to adModeUnknown.
val=Connection.Properties[propertyIndex]
Connection.Properties[propertyIndex]=newVal
propertiesCount=Connection.Properties.Count
propertyIndexString property name or Integer zero based index
of the property object in Connection.Properties collectionAnyValue 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. on ShowProperties ref
repeat with i= 0 to ref.Properties.Count - 1
put ref.Properties[i].Name & "=" &
ref.Properties[i]
end repeat
end
objADOProperty=Connection.Properties[propertyIndex].refpropertyName=objADOProperty.Nameval=objADOProperty.ValueobjADOProperty.Value=newValpropertiesCount=Connection.Properties.CountpropertyName=Connection.Properties[propertyIndex].NamepropertyType=Connection.Properties[propertyIndex].TypepropertyValue=Connection.Properties[propertyIndex].ValuepropertyAttributes=Connection.Properties[propertyIndex].Attributes on ShowProperties ref
repeat with i= 0 to ref.Properties.Count - 1
put ref.Properties[i].Name & "=" &
ref.Properties[i]
end repeat
end
propertyIndexString property name or Integer zero based index
of the property object in Connection.Properties collectionObjectADODB.Property objectProperty 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 |