Solved

ODBC

Posted on 1998-07-20
4
391 Views
Last Modified: 2010-05-03
I created a database in VB.  This database does not have an ODBC driver on it.  Is it possible to create an ODBC diriver for this database for MS Access through code, not the Control Panel.  I am looking for code if possible.  I am having much difficulty finding the answer to this question.
0
Comment
Question by:newyorker
4 Comments
 
LVL 1

Expert Comment

by:sen999
ID: 1466261
Dear Newyorker
      Are you looking for a Database Driver or DataSource. Because I think you can access the database which you created thru MS Access Driver itself. Are you really looking for a seperate driver?
Because in VB6.0 you can connect thru' ODBC without a DataSource in the client machine, just by specifying the name of the machine in which database resides , in Connection Object.
So please comment on this.
Regards
Senthil
0
 
LVL 9

Expert Comment

by:cymbolic
ID: 1466262
Chances are, you used DAO/Jet to create your database.  Like sen999 sez, if this is the case, you don't need an ODBC driver or ODBC DSN to access the database, because VB creates the database in Access compatiible format.  Please specify version of VB and Access you are using.  Different versions created different formats, but if you are uising Access 97 (ver 8.0 ) of Access you can read Acces 95 (Ver 7.0) databases but not the converse.  You can also look at the version of DAO in your VB project in the references list, and determine which version of Access database you are creating in VB.
0
 

Author Comment

by:newyorker
ID: 1466263
The reason I need to create an ODBC connection is because I am using a third party package to access this database and this package  will only link to an ODBC database.  I think that the only way  to create an ODBC connection is by use of the Control Panel. I know that I can then create a connection to that database through VB.  
0
 
LVL 1

Accepted Solution

by:
wizard2072098 earned 30 total points
ID: 1466264
If you need to programmatically create a DSN, the easiest way is to place a .DSN file into the directory:
\\ProgramFiles\CommonFiles\Odbc\DataSources.

The DSN file is pretty basic -- looks like an .INI file. Instead of trying to explain it, the easiest way for you to do it is to go into Control Panel and create a File DSN and store it in that directory. If you create a file like that programmatically, it will work.

To create a non File DSN, it's a little more work. Take a look at the "ODBC.INI" file as well as the "ODBCINST.INI" file in the Windows (or WinNT) directory.

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

837 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