Private Function KillObject(strDbName As String, acObjectType As Long,
strObjectName As String, StrPassword As String)
'Call KillObject(GPath, 0, "products")
Dim StrPassword As String
StrPassword = "secret"
Dim db As DAO.Database
Dim adb As Object
Set adb = CreateObject("Access.Application")
adb.OpenCurrentDatabase (strDbName,,strPassword)
adb.DoCmd.DeleteObject acObjectType, strObjectName
adb.CloseCurrentDatabase
Set adb = Nothing
End Function
--
Message posted via http://www.accessmonster.com
--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200711/1
adb.OpenCurrentDatabase strDbName, , StrPassword
this should work. Dunno why though since the VBA help on OpenCurrentDatabase
shows the brackets being used, but anyway, it worked for me without them,
though I did define the Exclusive parameter as False, thus
adb.OpenCurrentDatabase strDbName, False, StrPassword
Alec