• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 228
  • Last Modified:

create ODBC DSN entry in code

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
samic400
Asked:
samic400
1 Solution
 
CarlJWhiteCommented:
try this link...

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

I havent used it but just remember downloading the source code
0
 
robbertCommented:
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
 
Éric MoreauSenior .Net ConsultantCommented:
0
 
samic400Author Commented:
thank you. Other comments good but this is exactly hat I was looking for.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now