Structure of the ODBC file DSN

Source: Internet
Author: User
Tags format dsn odbc
Odbc
ODBC File DSN's little secret
1. Use the attached WordPad text editor to create a suffix named. The file for the DSN, formatted as follows, and then saved in text format:
Note: The format is important and must be saved as ' text format ', otherwise the editor should be OK.
#################################
[ODBC]
driver= driver Name
uid= User Name
pwd= Password
database= database name
Wsid= Server Name
app= (casually fill in)
Server= Server Name
###############################

2. To this. The DSN file is copied to your common files\odbc\datasources directory, and if you don't know the directory,
Try to build a file DSN in the Control Panel and then locate the file to get the directory.

3. Cn.open "filedsn= filename. dsn" can be connected.

****************************************************************************
Here are my tests.
1.MY.DSN file:
[ODBC]
Driver=sql Server
Uid=sa
Pwd=finegirl
Database=testdb
Wsid=tbb-it
App=netstar Application
Server=tbb-it

2. Copy to C:\Program Files\Common Files\odbc\datasources Directory

3. The procedure is called as follows:
Dim cn as New ADODB. Connection
cn. Open "Filedsn=my.dsn"
*****************************************************************************

Be clear enough, remember to add points, if you are handsome enough, please drink coffee. :)

I want to reply: Someone is involved in the discussion, please email me.

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.