TransferDatabase

F

FBxiii

Hi,

I have a piece of code to detect if the 'Live' or 'Development' version of a
database is opened.

When the dev. version is copied to the live folder, it detects this and
links to itself to the correct backend.

The backend however, is password protected and when each the DB links itself
to each table, the Password has to be input each time!

Is there anyway of supplying the password in code to save this happening?

Cheers,
Steve.
 
A

Alex Dybenko

You can modify Connect property to supply a password if required:

MyTable.Connect = ";DATABASE=" & FileName & ";PWD=" & Password & ""
 
F

FBxiii

Alex,

Thanks for the reply, but could you explain where I would do this?

The linking part of my code looks like this:

Do Until rstTbl.EOF

.strFName = "Linking " & rstTbl("Linked_Table_Name"): .Repaint

' Remove the current link.
DoCmd.DeleteObject acTable, rstTbl("Linked_Table_Name")

' Create the link to the Correct db.
DoCmd.TransferDatabase acLink, "Microsoft Access", strPath_Name,
acTable, rstTbl("Linked_Table_Name"), rstTbl("Linked_Table_Name")

rstTbl.MoveNext

Loop

Cheers,
Steve.
 

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