Another Run-Time error '3051' with Access and VB6

I have seen similar questions posed here before, but the solutions presented have not solved my particular problem.  I have a VB6 application connecting to a password protected Access 97 database, using DAO and Jet.  On a machine where Access is installed there does not seem to be a problem, but on a machine without Access I get the:

Run-time error '3051'
The Microsoft Jet dataase engine cannot open the file.... It is already opened exclusively by another user, or you need permission to view its data.

There are no permissions, other than the default user admin, and it is not open by any other user or application.  I am already making sure that the database is opened non-exclusively and is not read only.  Here is an extract from the opening code with the password info etc removed (regdata is a data object on the form filled by the following code to pass the password to the database):

Private Sub Form_Load()
Dim db As Database
Dim RegSet As Recordset, growthSet As Recordset, dateset As Recordset

'Create recordset of data required for registration
regdata.DatabaseName = "c:\Database\myDB.mdb"
regdata.RecordSource = "registration"
regdata.Connect = ";Pwd=xxxxx"
regdata.Refresh

Set db = OpenDatabase("c:\database\myDB.mdb", False, False)

Can anyone tell me what I am doing wrong here?

Cheers
Debbi
debbi_stottAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

debbi_stottAuthor Commented:
Edited text of question.
0
simonbennettCommented:
Could this be a funny system.mdw thingy?

If you haven;t tried this already as a solution try a

dbengine.systemdb = "x:\xxx\xxx\system.mdw"

as you may be using a corrupt or incorrect system.mdw file.

HTH

Simon
0
TimCotteeHead of Software ServicesCommented:
I think that you need to set the workgroup file using

DBEngine.SystemDB = "system.mdw"

in order to validate permissions properly. On machines that have Access installed, this will already be available however if it is not installed then you will need to identify it.

      
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

TimCotteeHead of Software ServicesCommented:
Simon got there first with the same thoughts, sorry to repeat!
0
debbi_stottAuthor Commented:
I have tried adding a dbengine.systemdb = "x:\xxx\xxx\system.mdw" line in my code where the system.mdw file is in the VB application directory, and the system.mdw file was copied from my own machine, where the application and database where developed.  Now I get a new error message:

Run-time error '3028'
Can't start your application.  the workgroup information file is missing or opened exclusively by another user.
0
AnswerTheManCommented:
you need to install a MS file called
"Dataacc.exe" on the target machine.
that is all.
that file can be located in OFFICE97 CD, or can be D\L from many sites. just run any searcg engine for it.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
simonbennettCommented:
Does the user have read/write permissions for that directory? I have seen the same error when system.mdw is in c:\winnt\system32 and users can't make changes.

Good Luck

Simon
0
debbi_stottAuthor Commented:
Thanks for all your help, but it actually turned out to be something much simpler.  In copying the database from the CD - the attributes on the database had been set to Read Only.  Removing this attribute enabled the application to run - even when I removed the system.mdw file and all reference to it in the application executable.

Even though your answers didn't actually solve the question - I really appreciate the hard thought and willingness to help.  You could not have known about the CD copy so I've marked you up as a gratefully good and acceptable answer.  It made me think and try things.  Thanks and cheers
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.