Solved

ODBC

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

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

13 Experts available now in Live!

Get 1:1 Help Now