Solved

ODBC

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

912 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

18 Experts available now in Live!

Get 1:1 Help Now