Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Database Administration » Starting and Connecting to Your Database » SQL Anywhere database connections » Connecting to a database using OLE DB

 

Connecting from ADO

ADO is an object-oriented programming interface. In ADO, the Connection object represents a unique session with a data source.

You can use the following Connection object features to initiate a connection:

  • The Provider property that holds the name of the provider. If you do not supply a Provider name, ADO uses the MSDASQL provider.

  • The ConnectionString property that holds a connection string. This property holds a SQL Anywhere connection string, which is used in the same way as the ODBC driver. You can supply ODBC data source names, or explicit UserID, Password, DatabaseName, and other parameters, just as in other connection strings.

  • The Open method initiates a connection.

Example

The following Visual Basic code initiates an OLE DB connection to SQL Anywhere:

' Declare the connection object
Dim myConn as New ADODB.Connection
myConn.Provider = "SAOLEDB"
myConn.ConnectionString = "DSN=SQL Anywhere 11 Demo"
myConn.Open
See also