MSSQL Server Database Connection Methods and SQL connection strings

Source: Internet
Author: User
Tags mssql server
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;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.