|
-
Apr 27th, 2006, 02:10 PM
#1
Thread Starter
Fanatic Member
Bogus Error Trying to Connect to Database
My VB program connects to an Access database that is located on a network drive.
This connection has worked seamlessly for months, and all of a sudden today it has derailed. I think it has something to do with the fact that I recently installed an old VB program on my computer. This recently installed program has nothing to do with the program I wrote, they are two entirely different things. Having said that though, I'd say the MDAC or something got all screwed up when I installed this older software earlier in the week.
Anyways, here's the problem.
I get an error in VB saying "Provider cannot be found. It may not be properly installed". This error occurs on the following line:
VB Code:
PhysDat.Open "Provide=MSDASQL.1;Persist Security Info=False;Data Source = PhysDat"
My first reaction was to "Google" this error. The only real solution I found was to change the provider to JET 4.0, which I tried, but to no ovail.
So I re-installed MDAC - Still not working.
To see exactly what was going on I created a Data Environment in my VB Project and tried to use the Connection Wizard to connect to the database.
This wizard works great when I try to connect to files on my local machine, but as soon as I try to connect to the file on the network drive, I get this...
"Microsoft Data Link Error - Test Connection failed because of an error initializing provider. Cannot start your application. The workgroup information file is missing or opened exclusively by another user."
Oh, and also....this error occurs when I try to access any of the 5 Access databases on the network drive, so it's not just the one I'm trying to access with my program.
Any ideas?
-
Apr 27th, 2006, 07:45 PM
#2
Re: Bogus Error Trying to Connect to Database
Have you tried re-installing your previous working program?
-
Apr 28th, 2006, 07:16 AM
#3
Thread Starter
Fanatic Member
Re: Bogus Error Trying to Connect to Database
It's not an executable. I get this error in VB while developing.
-
Apr 28th, 2006, 01:14 PM
#4
Re: Bogus Error Trying to Connect to Database
Have you tried reinstalling VB?
-
Apr 28th, 2006, 01:15 PM
#5
Re: Bogus Error Trying to Connect to Database
1) if u are accessing Access u are using the wrong connection string..
VB Code:
PhysDat.Open "Driver={Microsoft Access Driver (*.mdb)};Dbq=[B]C:\mydatabase.mdb[/B];Uid=;Pwd=;"
2) Get the UNC path to the Access Database and put in in place of the bold portion of the Conn string...
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Apr 28th, 2006, 01:30 PM
#6
Thread Starter
Fanatic Member
Re: Bogus Error Trying to Connect to Database
I don't think that's it and here's why.
1) It worked perfectly until recently.
2) When I add the data environment I can't even connect to this file using the connection wizard.
Also, I tried something else.
I created a brand new VB Project and tried to add a connection in the data environment to the file. Still...no dice.
I'm wondering if I inadvertantly set one of the users up with "Exclusive Access" in the ODBC connection.....that may explain it...what do you guys think? Then again though, other users should be having the same issue.
Last edited by The_Grudge; Apr 28th, 2006 at 01:34 PM.
-
Apr 28th, 2006, 01:39 PM
#7
Re: Bogus Error Trying to Connect to Database
Look for a file called System.mdw (the Access work-group file) on your hard-drive. Basically, it is a crappy security measure that is used to give people permissions to the database. I don't know the ins and outs of the mdw file, never used them. I just know they cause problems.
Was one installed by the old application?
-
Apr 28th, 2006, 01:46 PM
#8
Thread Starter
Fanatic Member
Re: Bogus Error Trying to Connect to Database
Hey Bruce,
There is one on my C drive (local machine) but not one on the network drive where the Access file resides. Perhaps this is normal though?
Anyways, it's called "System.MDW" as you state, and it is 108kb and is stored in "C:\Program Files\Common Files\System"
Should I erase it, edit it?
-
Apr 28th, 2006, 02:02 PM
#9
Thread Starter
Fanatic Member
Re: Bogus Error Trying to Connect to Database
UPDATE
I just went into the ODBC connection for this database and clicked on "REPAIR".
I got an error message saying that the file was opened exclusivley by another machine.
So let's say that IS the issue. Howcome I can still open Access directly with no issues. I thought once a file is opened exclusively, it won't work no matter how you access it.
-
May 1st, 2006, 11:26 AM
#10
Thread Starter
Fanatic Member
Re: Bogus Error Trying to Connect to Database
BUMP.
-
May 2nd, 2006, 09:15 PM
#11
Re: Bogus Error Trying to Connect to Database
Have you tried using the Jet provider instead?
-
May 3rd, 2006, 02:10 AM
#12
Re: Bogus Error Trying to Connect to Database
i dont know if this will help but i got this link when i googled
http://www.winsoft.sk/daofaq.htm#Q23
hope that helps
__________________
________________0îîî___
___îîî0________(___)____
__(___)_________) _/_____
___\_ (_________(_/______
____\_)_________________
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|