I am trying to have a vb app open one access database, read a table that is a list of modules and forms in another database, then import those objects from a second access database. Even though the objects already exist in the first db, I want to import them, rename the originals, rename the new copies to the original names, then delete the originals (per the instructions I have been given).
I don't know if I need to open an object for the second database or not.
Right now I'm just trying to get to the first database. They are password-protected. I can get code to open it, but it will always ask for the password.
I have tried using the Microsoft Access 10.0 Object Library, as well as the Microsoft DAO 3.6 Object Library.
I have tried instructions as they appear on the Microsoft site regarding "How to open a password-protected database through Automation in Access 2000" (
My current attempt produces User-defined type not defined at the declaration, even though I have both references set.
My current attempt at code:
I haven't managed to find something that will open it without having to log in, much less how to manipulate the objects.
Any help is very much appreciated.
Ahliana
Argue for your limitations and, sure enough, they're yours! - Richard Bach
I don't know if I need to open an object for the second database or not.
Right now I'm just trying to get to the first database. They are password-protected. I can get code to open it, but it will always ask for the password.
I have tried using the Microsoft Access 10.0 Object Library, as well as the Microsoft DAO 3.6 Object Library.
I have tried instructions as they appear on the Microsoft site regarding "How to open a password-protected database through Automation in Access 2000" (
Code:
'This is the Microsoft code
Option Compare Database
Option Explicit
Sub OpenPasswordProtectedDB()
'Define as Static so the instance of Access
'doesn't close when the procedure ends.
Static acc As Access.Application
Dim db As DAO.Database
Dim strDbName As String
strDbName = "C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb"
Set acc = New Access.Application
acc.Visible = True
Set db = acc.DBEngine.OpenDatabase(strDbName, False, False, ";PWD=nwind")
acc.OpenCurrentDatabase strDbName
db.Close
Set db = Nothing
End Sub
My current attempt produces User-defined type not defined at the declaration, even though I have both references set.
My current attempt at code:
Code:
Dim oAccessApp_ftlui As Access.Application
Dim db As DAO.Database
Dim sFTLUImdb As String
Dim sTemp As String
'strings get set in other code not shown, but should be good
Set oAccessApp_ftlui = New Access.Application
oAccessApp_ftlui.Visible = False
Set db = oAccessApp_ftlui.DBEngine.OpenDatabase(sFTLUImdb, False, False, ";PWD=" & sTemp)
oAccessApp_ftlui.OpenCurrentDatabase sFTLUImdb
I haven't managed to find something that will open it without having to log in, much less how to manipulate the objects.
Any help is very much appreciated.
Ahliana
Argue for your limitations and, sure enough, they're yours! - Richard Bach