ADO database connection string Daquan

Source: Internet
Author: User
Tags dsn odbc ole
This page contains sample ADO connection strings for odbc dsn/DSN-Less,
Ole db Providers, Remote Data Services (RDS), MS Remote, MS DataShape.
Also included are ADO. NET connection strings for each. NET Managed Provider
(SQLClient, OLEDB, and ODBC ).
Odbc dsn Connections
Using an odbc dsn (Data Source Name) is a two step process.
1) You must first create the DSN via the "ODBC Data Source Administrator" program
Found in your computer's Control Panel (or Administrative Tools menu in Windows 2000 ).
Make sure to create a system dsn (not a user dsn) when using ASP.
Note: You can also create the DSN via VB code.
2) Then use the following connection string-with your own DSN name of course .;-)
ODBC-DSN

OConn. Open "DSN = AdvWorks ;"&_
"Uid = Admin ;"&_
"Pwd =;
You can also create and use a File DSN. Then use the following ADO Connection string:
ODBC-File DSN

OConn. Open "FILEDSN = c: somepathmydb. dsn ;"&_
"Uid = Admin ;"&_
"Pwd = ;"
For more information, see: About ODBC data sources and
How to Use File DSNs and DSN-less Connections
Note: The problem with DSN is that Users can (and will) modify them (or delete by mistake ),
Then your program won't work so well... So it's better to use a DSN-Less or ole db Provider
Connection string with a Trusted Connection if possible!

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.