| ODBC |
| |
| Standard connection |
| Driver = {SQL Server}; server = myserveraddress; database = mydatabase; uid = myusername; Pwd = mypassword; |
|
| |
|
| Trusted connection |
| Driver = {SQL Server}; server = myserveraddress; database = mydatabase; trusted_connection = yes; |
|
| |
|
| Account and password |
| Oconn. properties ("prompt") = adpromptalways Driver = {SQL Server}; server = myserveraddress; database = mydatabase; |
|
| |
|
| Ole db, oledbconnection (. NET) |
| |
| Standard connection |
| Provider = sqloledb; Data Source = myserveraddress; initial catalog = mydatabase; user id = myusername; Password = mypassword; |
|
| |
|
| Trusted connection |
| Provider = sqloledb; Data Source = myserveraddress; initial catalog = mydatabase; Integrated Security = sspi; |
|
| You can use servername/InstanceName as the data source to specify an SQL server instance. |
|
|
| 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 = sqloledb; Data Source = myservername/theinstancename; initial catalog = mydatabase; Integrated Security = sspi; |
|
| |
|
| Account and password |
Oconn. provider = "sqloledb" Oconn. properties ("prompt") = adpromptalwaysData Source = myserveraddress; initial catalog = mydatabase; |
|
| |
|
| Use IP address connection |
| Provider = sqloledb; Data Source = 190.190.200.100, 1433; network library = dbmssocn; initial catalog = mydatabase; user id = myusername; Password = mypassword; |
|
| |
|
| Sqlconnection (. NET) |
| |
| Standard connection |
| Data Source = myserveraddress; initial catalog = mydatabase; user id = myusername; Password = mypassword; |
|
| |
|
| 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; |
|
| |
|
| 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; |
|
|
|
|
| Package Size |
| Server = myserveraddress; database = mydatabase; user id = myusername; Password = mypassword; trusted_connection = false; packet size = 4096; |
|
| The default package size is 8192 bytes. |
|
|
| Data shape |
| |
| MS data shape |
| Provider = msdatashape; data provider = sqloledb; Data Source = myserveraddress; initial catalog = mydatabase; user id = myusername; Password = mypassword; |
|
| |