Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2005

Tip: Looking for answers? Try searching our database.

TransferDatabase

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
FBxiii - 10 Jan 2005 11:05 GMT
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.
Alex Dybenko - 10 Jan 2005 11:28 GMT
You can modify Connect property to supply a password if required:

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

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

> Hi,
>
[quoted text clipped - 13 lines]
> Cheers,
> Steve.
FBxiii - 10 Jan 2005 12:09 GMT
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.

> You can modify Connect property to supply a password if required:
>
[quoted text clipped - 17 lines]
> > Cheers,
> > Steve.
Alex Dybenko - 10 Jan 2005 15:07 GMT
Hi,
i think in this case you have to modify your code and instead of
TransferDatabase create links by creating new tabledef, like in this sample:
http://www.mvps.org/access/tables/tbl0009.htm

Signature

Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com

> Alex,
>
[quoted text clipped - 44 lines]
>> > Cheers,
>> > Steve.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.