Relink to tables with password on BE

S

sk

I'm using Dev Ashish's code to relink tables and it works great on a
non-protected db. The issue I am having is that when I add a Password to the
BE, I can't get it to work. Where do I need to put the password in Dev's
code to get it to relink? I'm thinking it needs to be in the connection and
in the table link but I can't get it to work.


I added the password to the following code:

.Connect = ";Database=" & strDBPath & ";PWD=xxx10"

but it is breaking on this which is before the code above

Set dbLink = DBEngine(0).OpenDatabase(strDBPath)

I tried adding the password in the options for the .OpenDatabase but it did
not like the format.

Any help is appreciatied.
 
S

sk

From the errorcatch

Function: fRefreshLinks
Description: Not a valid password.
Error: 3031

It works fine on a db that does not have a password but when I add the
password I can not get it to connect / relink. I assume all the references
are fine and just need to figure out where to add the password in the code.
 
S

sk

Figured it out. If you are connecting to a password protected BE, you HAVE
to provide the OPTIONAL parameters as follows:

DBEngine(0).OpenDatabase(strDBPath, False, False, "MS Access;PWD=xxx10")

If you don't it just raises the password error.
 
E

Eighte

sk said:
Figured it out. If you are connecting to a password protected BE, you
HAVE
to provide the OPTIONAL parameters as follows:

DBEngine(0).OpenDatabase(strDBPath, False, False, "MS Access;PWD=xxx10")

If you don't it just raises the password error.

New:
Ok.sounds good.You and the Teachers come out with the Prowizzards. hmm...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top