Solved

create ODBC DSN entry in code

Posted on 2002-05-09
4
217 Views
Last Modified: 2010-05-02
I have a requirement where I need to create an ODBC DSN connection in VB code. I should also check to see if the system DSN entry exists first. I will be connecting to an Access database in my app.

Would anyone out here have a snippet of code on how to do this?

I would greatly appreciate it.

Thanks in advance.
0
Comment
Question by:samic400
4 Comments
 

Accepted Solution

by:
CarlJWhite earned 85 total points
ID: 6999262
try this link...

http://www.thescarms.com/vbasic/CreateDSN.asp

I havent used it but just remember downloading the source code
0
 
LVL 15

Expert Comment

by:robbert
ID: 6999352
Why don't you open the connection DSN-less? A connection string for ADO is:

oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq=c:\somepath\mydb.mdb;"
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 6999484
0
 
LVL 13

Author Comment

by:samic400
ID: 7009192
thank you. Other comments good but this is exactly hat I was looking for.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now