Append Query Using VBA

markwakelin

New member
Local time
Today, 05:24
Joined
Jun 3, 2003
Messages
8
I am using VB6 and have connected to an Access database.
I have then wrote a function to "append" all data from this database into another database.
However, this works fine so long as my "new" database does not have a "database password".
Is there any way I can pass the password via VB in an append query structure ??

Mark
 
Here's some sample code on how to open another database using user-level security:
Sub TestCode()
Dim wks As DAO.Workspace
Dim dbs As DAO.Database

Set wks = DBEngine.CreateWorkspace("databasename", "userid", "password")
Set dbs = wks.OpenDatabase("c:\databasename.mdb")

End Sub
 

Users who are viewing this thread

Back
Top Bottom