Standard Security
Standard Security alternative syntax
Trusted Connection
Trusted Connection alternative syntax
Connecting to an SQL Server instance
Trusted Connection from a CE device
Connect via an IP address
Enabling MARS (multiple active result sets)
Attach a database file on connect to a local SQL Server Express instance
Attach a database file, located in the data directory, on connect to a local SQL Server Express instance
Using an User Instance on a local SQL Server Express instance
Database mirroring
Asynchronous processing
Standard security
Trusted connection
Connecting to an SQL Server instance
Prompt for username and password
Enabling MARS (multiple active result sets)
Encrypt data sent over network
Attach a database file on connect to a local SQL Server Express instance
Attach a database file, located in the data directory, on connect to a local SQL Server Express instance
Database mirroring
Bridging to SQL Native Client OLE DB
Standard security
Trusted connection
Connecting to an SQL Server instance
Provider=SQLNCLI10;Server=myServerName\theInstance Name;Database=DATABASE-NAME; Trusted_Connection=yes;
Prompt for username and password
Enabling MARS (multiple active result sets)
Encrypt data sent over network
Attach a database file on connect to a local SQL Server Express instance
Attach a database file, located in the data directory, on connect to a local SQL Server Express instance
Database mirroring
Data Source=SERVER-IP;Initial Catalog=DATABASE-NAME;User Id=USERNAME;Password=PASSWORD;
Server=SERVER-IP;Database=DATABASE-NAME;User ID=USERNAME;Password=PASSWORD;Trusted_Connection=F alse;
Data Source=SERVER-IP;Initial Catalog=DATABASE-NAME;Integrated Security=SSPI;
Server=SERVER-IP;Database=DATABASE-NAME;Trusted_Connection=True;
Server=myServerName\theInstanceName;Database=DATAB ASE-NAME;Trusted_Connection=True;
Data Source=SERVER-IP;Initial Catalog=DATABASE-NAME;Integrated Security=SSPI;User ID=myDomain\myUsername;Password=myPassword;
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=DATABASE-NAME;User ID=USERNAME;Password=PASSWORD;
Server=SERVER-IP;Database=DATABASE-NAME;Trusted_Connection=True; MultipleActiveResultSets=true;
Server=.\SQLExpress;AttachDbFilename=c:\mydbfile.m df;Database=dbname; Trusted_Connection=Yes;
Server=.\SQLExpress;AttachDbFilename=|DataDirector y|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;
Data Source=.\SQLExpress;Integrated Security=true; AttachDbFilename=|DataDirectory|\mydb.mdf;User Instance=true;
Data Source=SERVER-IP;Failover Partner=myMirrorServerAddress;Initial Catalog=DATABASE-NAME;Integrated Security=True;
Server=SERVER-IP;Database=DATABASE-NAME;Integrated Security=True;Asynchronous Processing=True;
Provider=SQLNCLI;Server=SERVER-IP;Database=DATABASE-NAME;Uid=USERNAME; Pwd=PASSWORD;
Provider=SQLNCLI;Server=SERVER-IP;Database=DATABASE-NAME;Trusted_Connection=yes;
Provider=SQLNCLI;Server=myServerName\theInstanceNa me;Database=DATABASE-NAME; Trusted_Connection=yes;
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Provider=SQLNCLI;Server=SERVER-IP;DataBase=DATABASE-NAME;
oConn.Open "Provider=SQLNCLI;Server=SERVER-IP;DataBase=DATABASE-NAME;
Provider=SQLNCLI;Server=SERVER-IP;Database=DATABASE-NAME; Trusted_Connection=yes;MARS Connection=True;
Provider=SQLNCLI;Server=SERVER-IP;Database=DATABASE-NAME; Trusted_Connection=yes;Encrypt=yes;
Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilen ame=c:\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;
Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilen ame=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;
Provider=SQLNCLI;Data Source=SERVER-IP;Failover Partner=myMirrorServerAddress;Initial Catalog=DATABASE-NAME;Integrated Security=True;
Provider=SQLNCLI;Server=SERVER-IP;Database=DATABASE-NAME;Uid=USERNAME; Pwd=PASSWORD;
Provider=SQLNCLI10;Server=SERVER-IP;Database=DATABASE-NAME;Uid=USERNAME; Pwd=PASSWORD;
Provider=SQLNCLI10;Server=SERVER-IP;Database=DATABASE-NAME;Trusted_Connection=yes;
Provider=SQLNCLI10;Server=myServerName\theInstance Name;Database=DATABASE-NAME; Trusted_Connection=yes;
Prompt for username and password
oConn.Properties("Prompt") = adPromptAlways
oConn.Open "Provider=SQLNCLI10;Server=SERVER-IP;DataBase=DATABASE-NAME;
oConn.Open "Provider=SQLNCLI10;Server=SERVER-IP;DataBase=DATABASE-NAME;
Provider=SQLNCLI10;Server=SERVER-IP;Database=DATABASE-NAME; Trusted_Connection=yes;MARS Connection=True;
Provider=SQLNCLI10;Server=SERVER-IP;Database=DATABASE-NAME; Trusted_Connection=yes;Encrypt=yes;
Provider=SQLNCLI10;Server=.\SQLExpress;AttachDbFil ename=c:\mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;
Provider=SQLNCLI10;Server=.\SQLExpress;AttachDbFil ename=|DataDirectory|mydbfile.mdf; Database=dbname;Trusted_Connection=Yes;
Provider=SQLNCLI10;Data Source=SERVER-IP;Failover Partner=myMirrorServerAddress;Initial Catalog=DATABASE-NAME;Integrated Security=True;