A simple method to obtain the data connection string (udl file)

Source: Internet
Author: User
Tags ole

EditingProgramThe long data connection string can't be remembered by the average person. Most people use it after finding the ready-made data on the Internet, but it is still very troublesome after all, sometimes I still cannot find a suitable solution at half past one. I accidentally found a very good solution on the internet today. It's really too convenient !!

 

  • First, create a TXT text file named conn on the desktop, change the suffix to udl, and double-click it to open the corresponding dialog box.
  • Next, we select the connection to be set. Here we select SQL Server
  • Then, click "OK" to go to the server selection page and confirm the authentication method and database column.
    If it is local, use Windows integrated authentication. If it is not local, use SQL authentication. After setting it, you can test the connection.
  • If the connection is successful, a connection to the database is automatically generated in the conn file.Code, We only need to put this code in the database connection string.

For example, the string used for Windows Integrated Identity Authentication is:
[Oledb]
; Everything after this line is an ole db initstring
Provider = sqloledb.1; Integrated Security = sspi; persist Security info = false; user id = sa; Data Source = pcyx/sqlexpress

The SQL Server Authentication string is:

[Oledb]
; Everything after this line is an ole db initstring
Provider = sqloledb.1; Password = 111; persist Security info = true; user id = sa; Data Source = pcyx/sqlexpress

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.