Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Append data to password protected database

Status
Not open for further replies.

McWhorter

Technical User
Jul 18, 2002
21
US
I have a command box on a form that when clicked, does several tasks, one of which runs an append query to copy records to another database. It WORKS great.

Well, now we have to put a database password on the other database so the append query wont work.

Anyone have some code that I can use to enter the password into the other DB so the append query will run. I dont care if the password can be looked up in the vba.

Thanks,
 
I got it to work finally after alot of searching around on this website. Here was the code if anyone is interested.

Dim wrk As Workspace
Dim dbProtected As Database
Dim objAccess As Access.Application
Set wrk = DBEngine.Workspaces(0)
Set dbProtected = wrk.OpenDatabase
("c:\database.mdb", False, False, ";PWD=password")

DoCmd.OpenQuery ("Append_Query"), acViewNormal, acEdit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top