?
Solved

create ODBC DSN entry in code

Posted on 2002-05-09
4
Medium Priority
?
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Accepted Solution

by:
CarlJWhite earned 340 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 70

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 Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…
Suggested Courses
Course of the Month14 days, 22 hours left to enroll

771 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