MultipleActiveResultSets=true equals MARS_Connection=yes
Using MARS with SQL Native Client, by Chris Lee >>
Encrypt data sent over network:
"Driver={SQL Native Client};Server=Aron1;Database=pubs;Trusted_Connection=yes;Encrypt=yes"
Attach a database file on connect to a local SQL Server Express instance:
"Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;" - or - "Driver={SQL Native Client};Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;" (use |DataDirectory| when your database file resides in the data directory)
Why is the "Database" parameter needed? Answer: If the database was previously attached, SQL Server does not reattach it (it uses the attached database as the default for the connection).
Download the SQL Native Client here >> (the package contains booth the ODBC driver and the OLE DB provider)
Using SQL Server 2005 Express? Don't miss the server name syntax: SERVERNAME\SQLEXPRESS (Substitute "SERVERNAME" with the name of the computer)
SQL Native Client OLE DB Provider
- Standard security:
"Provider=SQLNCLI;Server=Aron1;Database=pubs;UID=sa;PWD=asdasd;"
- Trusted connection:
"Provider=SQLNCLI;Server=Aron1;Database=pubs;Trusted_Connection=yes;"
Equivalents Integrated Security=SSPI equals Trusted_Connection=yes
- Prompt for username and password:
oConn.Properties("Prompt") = adPromptAlways oConn.Open "Provider=SQLNCLI;Server=Aron1;DataBase=pubs;"
- Enabling MARS (multiple active result sets):
"Provider=SQLNCLI;Server=Aron1;Database=pubs;Trusted_Connection=yes;MarsConn=yes"
Equivalents MarsConn=yes equals MultipleActiveResultSets=true equals MARS_Connection=yes
Using MARS with SQL Native Client, by Chris Lee >>
- Encrypt data sent over network:
"Provider=SQLNCLI;Server=Aron1;Database=pubs;Trusted_Connection=yes;Encrypt=yes"
- Attach a database file on connect to a local SQL Server Express instance:
"Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilename=c:\asd\qwe\mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;" - or - "Provider=SQLNCLI;Server=.\SQLExpress;AttachDbFilename=|DataDirectory|mydbfile.mdf;Database=dbname;Trusted_Connection=Yes;" (use |DataDirectory| when your database file resides in the data directory)
Why is the "Database" parameter needed? Answer: If the database was previously attached, SQL Server does not reattach it (it uses the attached database as the default for the connection).
Download the SQL Native Client here >> (the package contains booth the ODBC driver and the OLE DB provider)
Using SQL Server 2005 Express? Don't miss the server name syntax: SERVERNAME\SQLEXPRESS (Substitute "SERVERNAME" with the name of the computer)
SqlConnection (.NET)
|