Solved

ODBC

Posted on 1998-07-20
4
395 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

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

Suggested Solutions

Title # Comments Views Activity
Saving history changes to sub form 4 51
How to debug this code 7 65
How to Add / Edit Windows Menu 4 73
Formula problem with Excel attachment 6 43
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

735 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