Clive Beaton
asked on
Syntax of Opendatabase for a jet db to specify workgroup, user, and password.
Access 2003. I want open a second database in my application mdb using the opendatabase method. The second database is in a different workgroup and has Access security with a username and password.
The purpose is to set DB = (second database) so that I can run queries to import the data into the current database. I could do it with ADO but I think this involves writing a lot of code.
Can anyone help?
Thanks in advance.
The purpose is to set DB = (second database) so that I can run queries to import the data into the current database. I could do it with ADO but I think this involves writing a lot of code.
Can anyone help?
Thanks in advance.
ASKER
peter57r
Thanks. The code snippet gives an error 3029 'Not a valid account name or password' on the line: Set WS = (etc)
The account name and password are correct.
Can you help?
Thanks.
Thanks. The code snippet gives an error 3029 'Not a valid account name or password' on the line: Set WS = (etc)
The account name and password are correct.
Can you help?
Thanks.
Private Function opentables() As Boolean
Dim WS As DAO.Workspace
Dim DB As DAO.Database
Dim RS As DAO.Recordset
DBEngine.SystemDB = "C:\cela\cela.mdw"
Set WS = CreateWorkspace("NewWS", "cela_designer", "d7+_SeK!", dbUseJet)
Set DB = WS.opendatabase("C:\cela\CELA.data.mdb")
Set RS = DB.OpenRecordset("Users")
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks you very much.
Make sure you prefix the objects with 'DAO.'