Connectionstring string Summary

Source: Internet
Author: User

There are already many examples of using VB to connect to the database over the past few days. It is estimated that the most difficult thing to do is to write the connectionstring string. This attribute is very important, A Property contains several small attributes, which are not easy to write completely. I often paste the previously written attributes.

Below we will summarize the common attributes of this string:

(1). Use the SQL Server database connection string (the yellow strip is the parameter that must be set to use remote connection)

SQL connection to database

Attribute

Function

Example

Provider

Database driver

Provider = sqloledb.1

Integrated Security

Set whether to use system integration verification during logon

Integrated Security = sspi

Persist Security info

Set whether to save Security Information (Save Password, etc)

Persist Security info = false

Initial catalog

Database Name

Initial catalog = instance 1

Data Source

If remote access is not used (only local access is used), do not write the data source = (local)

Data Source = XDP-PC or data source = 192.168.24.144

User ID

User ID used to connect to the database

User ID = sa

Password

Database connection password

Password = 123456

 

(2). Use the Access database to connect to a string

Access Database

Attribute

Function

Example

Provider

Database driver

Provider = Microsoft. Jet. oledb.3.51 or 4.0

Data Source

Database source, which is generally a physical path

Data Source = & App. Path & "\ instance 1.mdb"

 

 

(3). Use ODBC to connect to a string

ODBC

Attribute

Function

Example

DSN

Set the created DSN (user, system, and file)

DSN = instance 2dsn

 

These hopes are helpful to everyone.

 

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.