SQL native client ODBC driver |
|
Standard secure connection |
|
|
Driver = {SQL native client}; server = myserveraddress; database = mydatabase; uid = myusername; Pwd = mypassword; |
|
Are you using SQL Server 2005 Express? Use the connection expression "Host Name \ sqlexpress" in the "server" option ". |
|
|
Trusted connection |
|
|
Driver = {SQL native client}; server = myserveraddress; database = mydatabase; trusted_connection = yes; |
|
"Integrated Security = sspi" is the same as "trusted_connection = yes. |
|
|
Connect to an SQL server instance |
The expression of the specified server instance is the same as the connection string of other SQL servers. |
|
Driver = {SQL native client}; server = myservername \ theinstancename; database = mydatabase; trusted_connection = yes; |
|
|
|
User name and password |
Oconn. properties ("prompt") = adpromptalways Driver = {SQL native client}; server = myserveraddress; database = mydatabase; |
|
|
|
Use Mars (multiple active result sets) |
|
|
Driver = {SQL native client}; server = myserveraddress; database = mydatabase; trusted_connection = yes; mars_connection = yes; |
|
"Multipleactiveresultsets = true" is the same as mars_connection = yes. |
Use ADO. NET 2.0 as the module of Mars. Mars does not support ADO. NET 1.0 and ADO. NET 1.1. |
|
|
Verify Network Data |
|
|
Driver = {SQL native client}; server = myserveraddress; database = mydatabase; trusted_connection = yes; encrypt = yes; |
|
|
|
Connect to the local SQL Server express instance by attaching a local database file |
|
|
Driver = {SQL native client}; server =. \ sqlexpress; attachdbfilename = c: \ ASD \ qwe \ mydbfile. MDF; database = dbname; trusted_connection = yes; |
|
Why use database parameters? If a database with the same name has been attached, SQL server will not attach it again. |
|
|
Connect to the local SQL Server express instance by attaching a database file in the local data folder |
|
|
Driver = {SQL native client}; server =. \ sqlexpress; attachdbfilename = | datadirectory | mydbfile. MDF; database = dbname; trusted_connection = yes; |
|
Why use database parameters? If a database with the same name has been attached, SQL server will not attach it again. |
|
|
Database image |
Data Source = myserveraddress; failover partner = mymirrorserver; initial catalog = mydatabase; Integrated Security = true; |
|
|
|
SQL native client OLE DB Provider |
|
Standard connection |
|
|
Provider = sqlncli; server = myserveraddress; database = mydatabase; uid = myusername; Pwd = mypassword; |
|
Are you using SQL Server 2005 Express? Use the connection expression "Host Name \ sqlexpress" in the "server" option ". |
|
|
Trusted connection |
|
|
Provider = sqlncli; server = myserveraddress; database = mydatabase; trusted_connection = yes; |
|
"Integrated Security = sspi" is the same as "trusted_connection = yes" |
|
|
Connect to an SQL server instance |
The expression of the specified server instance is the same as the connection string of other SQL servers. |
|
Provider = sqlncli; server = myservername \ theinstancename; database = mydatabase; trusted_connection = yes; |
|
|
|
Use account and password |
Oconn. properties ("prompt") = adpromptalways Oconn. Open "provider = sqlncli; server = myserveraddress; database = mydatabase; |
|
|
|
Use Mars (multiple active result sets) |
|
|
Provider = sqlncli; server = myserveraddress; database = mydatabase; trusted_connection = yes; marsconn = yes; |
|
"Multipleactiveresultsets = true" and "mars_connection = yes" are the same. |
Use ADO. NET 2.0 as the module of Mars. Mars does not support ADO. NET 1.0 and ADO. NET 1.1. |
|
|
Verify Network Data |
|
|
Provider = sqlncli; server = myserveraddress; database = mydatabase; trusted_connection = yes; encrypt = yes; |
|
|
|
Connect to the local SQL Server express instance by attaching a local database file |
|
|
Provider = sqlncli; server =. \ sqlexpress; attachdbfilename = c: \ ASD \ qwe \ mydbfile. MDF; database = dbname; trusted_connection = yes; |
|
Why use database parameters? If a database with the same name has been attached, SQL server will not attach it again. |
|
|
Connect to the local SQL Server express instance by attaching a database file in the local data folder |
|
|
Provider = sqlncli; server =. \ sqlexpress; attachdbfilename = | datadirectory | mydbfile. MDF; database = dbname; trusted_connection = yes; |
|
Why use database parameters? If a database with the same name has been attached, SQL server will not attach it again. |
|
|
Database image |
Data Source = myserveraddress; failover partner = mymirrorserver; initial catalog = mydatabase; Integrated Security = true; |
|
|
|
Sqlconnection (. NET) |
|
Standard connection |
|
|
Data Source = myserveraddress; initial catalog = mydatabase; user id = myusername; Password = mypassword; |
|
You can use servername \ InstanceName as the data source to specify an SQL server instance. |
Are you using SQL Server 2005 Express? Use the connection expression "Host Name \ sqlexpress" in the "server" option ". |
|
|
Standard Security alternative syntax |
Server = myserveraddress; database = mydatabase; user id = myusername; Password = mypassword; trusted_connection = false; |
|
|
|
Trusted connection |
|
|
Data Source = myserveraddress; initial catalog = mydatabase; Integrated Security = sspi; |
|
|
|
Trusted connection alternative syntax |
Server = myserveraddress; database = mydatabase; trusted_connection = true; |
|
|
|
Connect to an SQL server instance |
The expression of the specified server instance is the same as the connection string of other SQL servers. |
|
Server = myservername \ theinstancename; database = mydatabase; trusted_connection = true; |
|
|
|
Secure connection from wince Device |
Data Source = myserveraddress; initial catalog = mydatabase; Integrated Security = sspi; user id = mydomain \ myusername; Password = mypassword; |
|
Only applicable to CE devices. |
|
|
Connections with IP addresses |
|
|
Data Source = 190.190.200.100, 1433; network library = dbmssocn; initial catalog = mydatabase; user id = myusername; Password = mypassword; |
|
|
|
Use Mars (multiple active result sets) |
|
|
Server = myserveraddress; database = mydatabase; trusted_connection = true; multipleactiveresultsets = true; |
|
Use ADO. NET 2.0 as the module of Mars. Mars does not support ADO. NET 1.0 and ADO. NET 1.1. |
|
|
Connect to the local SQL Server express instance by attaching a local database file |
|
|
Server =. \ sqlexpress; attachdbfilename = c: \ ASD \ qwe \ mydbfile. MDF; database = dbname; trusted_connection = yes; |
|
Why use database parameters? If a database with the same name has been attached, SQL server will not attach it again. |
|
|
Connect to the local SQL Server express instance by attaching a database file in the local data folder |
|
|
Server =. \ sqlexpress; attachdbfilename = | datadirectory | mydbfile. MDF; database = dbname; trusted_connection = yes; |
|
Why use database parameters? If a database with the same name has been attached, SQL server will not attach it again. |
|
|
Use a user instance on an SQL Server express instance |
Data Source =. \ sqlexpress; Integrated Security = true; attachdbfilename = | datadirectory | \ mydb. MDF; user instance = true; |
|
Database image |
Data Source = myserveraddress; failover partner = mymirrorserver; initial catalog = mydatabase; Integrated Security = true; |
|
Asynchronous Processing |
Server = myserveraddress; database = mydatabase; Integrated Security = true; asynchronous Processing = true; |
|