Description
This function establishes an open connection to a database using an ADO connection string. A user-assigned ID number must be passed in to distinguish connections made this way from one another. The return value is an ADO Connection object.
Applicable Events
ZoneLink
Syntax
object.AllocConnection(nID, strConnectionString)
Parameters
Object is a reference to the Application object. For more information, see Application Object (page Application Object).
AllocConnection is the command.
nID is is the user ID number.
strConnectionString is the database connection string.
Example
Set oCnn = Application.AllocConnection(34, "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyTable;Data Source=my_sql_server")
Set rst = oCnn.OpenRecordset