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

Wrong number of arguments

0 views
Skip to first unread message

samotek via AccessMonster.com

unread,
Nov 14, 2007, 12:46:22 PM11/14/07
to
i get the error "wrong number of arguments or invalid proprty assignment"
Can you help me with this problem ?
Private Function KillObject(strDbName As String, acObjectType As Long,
strObjectName As String, 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


Private Sub Command2_Click()
Call KillObject(GPath, 0, "products", "secret")

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-modules/200711/1

Douglas J. Steele

unread,
Nov 14, 2007, 1:25:55 PM11/14/07
to
According to the Help file, the OpenCurrentDatabase method only takes 2
arguments: the full path to the database, and (optionally) a boolean value
which specifies whether the database should be opened in exclusive mode.

To see how to open a password-protected database, see
http://support.microsoft.com/kb/235422

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"samotek via AccessMonster.com" <u15330@uwe> wrote in message
news:7b360769b1546@uwe...

0 new messages