Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ODBC

Posted on 1998-07-20
4
Medium Priority
?
407 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 90 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses

886 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