Description
Use this property to obtain the ADO Connection
object, which the ADODriverObj driver uses to work with a recordset holding the desired data.
Declaration
ADODriverObj.ADOConnection
Read-Only Property | An ADO Command object |
ADODriverObj | An expression, variable or parameter that specifies a reference to an ADODriver object |
Applies To
The property is applied to the following object:
Property Value
The ADO Connection
object used by ADODriverObj.
Example
The code below connects to the specified database, performs some actions over the database's records and then closes the connection by using the ADOConnection
method.
Note: |
Using the Microsoft.Jet.OLEDB.4.0 provider requires that you run your script in the 32-bit version of TestComplete. TestComplete 32-bit executable is located in the <TestComplete>\Bin folder. |
JavaScript, JScript
function ADOConnectionDemo()
{
// Specifies the connection string
var ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=C:\\Microsoft Visual Studio\\VB98\\biblio.mdb";
// Specifies the name of the table
var tName = "myTable";
// Performs some actions over the table records
// Closes the connection to the specified database
DDT.ADODriver(ConStr, tName).ADOConnectionObject.Close();
}
Python
def ADOConnectionDemo():
# Specifies the connection string
ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=C:\\Microsoft Visual Studio\\VB98\\biblio.mdb"
# Specifies the name of the table
tName = "myTable"
# Performs some actions over the table records
# Closes the connection to the specified database
DDT.ADODriver(ConStr, tName).ADOConnectionObject.Close()
VBScript
Sub ADOConnectionDemo
' Specifies the connection string
ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;" + _
"Data Source=C:\Microsoft Visual Studio\VB98\biblio.mdb"
' Specifies the name of the table
tName = "myTable"
' Performs some actions over the table records
' Closes the connection to the specified database
Call DDT.ADODriver(ConStr, tName).ADOConnectionObject.Close
End Sub
DelphiScript
function ADOConnectionDemo;
var ConStr, tName;
begin
// Specifies the connection string
ConStr := 'Provider=Microsoft.Jet.OLEDB.4.0;' +
'Data Source=C:\Microsoft Visual Studio\VB98\biblio.mdb';
// Specifies the name of the table
tName := 'myTable';
// Performs some actions over the table records
// Closes the connection to the specified database
DDT.ADODriver(ConStr, tName).ADOConnectionObject.Close();
end;
C++Script, C#Script
function ADOConnectionDemo()
{
// Specifies the connection string
var ConStr = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=C:\\Microsoft Visual Studio\\VB98\\biblio.mdb";
// Specifies the name of the table
var tName = "myTable";
// Performs some actions over the table records
// Closes the connection to the specified database
DDT["ADODriver"]( ConStr, tName )["ADOConnectionObject"]["Close"]();
}