MSSQL Server Database Connection Methods and SQL connection strings
Microsoft ole db of SQL Server providesProgramAnd ODBC's Microsoft ole db Provider link to the SQL Server database, but it finds a problem that has never been noticed before.
When using conn.exe cute: the first method is completely normal. However, in ODBC mode, some data cannot be read (or read as null) in some cases ), the specific reason is unclear. After checking for a long time, no difference is found. Later, the first method was used.
Note: The problem is the same with that in SQL Server 2000 and SQL Server 2005 databases.
Method 1: ole db or oledbconnection (. NET)
(Use the Microsoft ole db provider of SQL Server)
Provider = sqloledb; Data Source = Server IP address; initial catalog = database name; user id = user name; Password = password;
Method 2: ODBC (using the Microsoft ole db provider of ODBC)
Driver = {SQL Server}; server = Server IP address; database = database name; uid = user name; Pwd = password;
Method 3: DSN
DSN = DSN name; uid = user name; Pwd = password;
Method 4: sqlconnection (. NET)
Data Source = Server IP address; initial catalog = database name; user id = username; Password = password;