Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Compile error

0 views
Skip to first unread message

samotek via AccessMonster.com

unread,
Nov 14, 2007, 2:23:02 AM11/14/07
to
n my function listed below i get compile error in the following line :
adb.OpenCurrentDatabase (strDbName,,strPassword)
can you help ?

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

samotek via AccessMonster.com

unread,
Nov 14, 2007, 2:23:13 AM11/14/07
to

alecwood via AccessMonster.com

unread,
Nov 14, 2007, 8:02:55 AM11/14/07
to
If you take the brackets off on that line thus

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

0 new messages