Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB 6 and Access 7--Provider Not Found

Status
Not open for further replies.

PTW

Programmer
Jul 7, 2000
82
0
0
CA
Hello Everyone!

I am trying to connect to an Access 7.0 Database using VB 6 and ADO. I am really bad/rusty with this stuff!

Anyway, when I run it from my development computer either from within VB or as the installed application, it is fine. When I install it elsewhere, I get the following error:

Runtime error 3706
Provider cannot be found. It may not be properly installed.

In my application, this is how I named the provider:

cnnAccess.Provider = "Microsoft.Jet.OLEDB.3.51"
cnnAccess.Open "S:\Test Database\Test Data.mdb"

The computer I installed the application onto has that S: drive mapped and can see the database file.

In my project References, I have included the ADO 2.5 Library, and also the DAO 3.51 Object Library.

Any suggestions on what I am doing wrong? How can I make sure that the correct Provider is installed on the target computer?

Thanks!
 
Basically, version 3.51 of Jet isn't installed on your machine. To figure out your configuration, see

Code:
[URL unfurl="true"]http://support.microsoft.com/default.aspx?scid=kb;en-us;197902[/URL]

Also, get rid of the reference to DAO. It's a different data access technology that will only confuse things for you.

Finally, only worry about the libraries that are installed on the computer where your program is running. "S:" is just a drive to your program.

--David
 
I'm not sure what version "Access 7" means. If it is an Office 2000 MDB, then Jet 3.51 will not read it. You need Jet 4.0 installed. MDAC_EXE no longer has JET. will get you Jet 4.0 SP3.

I hate disagree with my esteemed colleague, harebrain, but JET/DAO is still the preferred interface for MDB files.

Microsoft provides an excellent tool for checking MDAC levels called "Component Checker." You can get it at
 
Thanks for the help everyone.

I could not locate the old MDAC 2.0 for download so I managed to install from my Visual Studio 6.0 CDs. Now it works! I guess my confusion was that I thought the appropriate MDAC files would get built into the install automatically.

jpittawa, by "Access 7.0" I meant the version of Access with Office 97 Pro.
 
Yes, the JET provider for a JET 3.51 '97 MDB would have been installed with MDAC 2.1, and for JET 4.0 '2000 MDB it would have been installed with MDAC 2.5.
With future versions of MDAC, the JET provider is not included, and you need to install the JET 4 SP.

But, your best bet when working with ADO and JET is to use the JET 4.0 provider. It will read and write to JET 3.51 '97 MDB's as well.
Otherwise, you will have problems when distributing your application. You would then also need a means to install and register the 3.51 Provider. [/b][/i][/u][sub]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
 
To clarify my previous post regarding the originally cited references, both for PTW and jpittawa:

In his (her?) post, PTW stated that he is using ADO. By advising him to remove the reference to DAO, I was not advising that he use ADO rather than DAO; that choice had already been made. I do advise that references to both API's is unnecessary and misguided. I still say, if you're not using DAO, don't reference it.

Confusion will erupt where both libraries contain classes with the same name, not to mention that it's more convenient to write "Connection" than "ADODB.Connection", etc.

--David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top