TransferDatabase

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
You can modify Connect property to supply a password if required:

MyTable.Connect = ";DATABASE=" & FileName & ";PWD=" & Password & ""
 
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.
 
Back
Top