Re: Invalid Procedure Call or Arguement by Matt
Matt
Fri May 05 15:50:44 CDT 2006
Thanks Bob.
If I set the argument to VariantType in my function, how can I then access
the object properties in the function?
"Bob Lehmann" <nospam@dontbotherme.zzz> wrote in message
news:uvVmo4HcGHA.4108@TK2MSFTNGP03.phx.gbl...
> Oops! I didn't read your initial post.
>
> Still pretty much the same answer.
>
> Everything in VBScript is a variant, so, if I remember correctly, the args
> in the dll's Subs / Functions need to be of type Variant.
>
>
> Bob Lehmann
>
>
> "Matt" <mamarsha@newsgroups.nospam> wrote in message
> news:%23W6KGwHcGHA.3900@TK2MSFTNGP05.phx.gbl...
>> I have found the culprit but I am not sure why it worked in .NET ok but
> not
>> from an ASP page? The GetUsers function accepted a parameter of the type
>> mnasecurityUser object.
>>
>>
>>
>> Public Function GetUsers(ByRef oUser as mnasecurityUser) as
>> mnasecurityGroups
>>
>>
>>
>> From my code I passed in oUser which was instantiated as a
>> mnasecurityUser
>> object (see previous post for code)
>>
>>
>>
>> I changed the function in my object to accept a UserID as an integer and
>> everything worked fine.
>>
>>
>>
>> Public Function GetUsers(ByRef iUser As Integer) as mnasecurityGroups
>>
>>
>>
>> From my Asp page I updated the following line of code
>>
>>
>>
>> Set oUser.Groups = oDBAdpater.GetUsers(oUser)
>>
>>
>>
>> to
>>
>>
>>
>> Set oUser.Groups = oDBAdpater.GetUsers(oUser.ID)
>>
>>
>>
>> Does anyone know why I can't pass an object as a parameter from an ASP
> page?
>> Or let me know what I did wrong in my ASP page when I was trying to pass
> the
>> object?
>>
>>
>>
>> Thanks.
>>
>>
>>
>> "Matt" <mamarsha@newsgroups.nospam> wrote in message
>> news:uxV96zEcGHA.4892@TK2MSFTNGP02.phx.gbl...
>> >I am receiving the following error from the simple script below. This
> works
>> >fine from a .NET form but when I access the dll from a Classic ASP page
> it
>> >fails.
>> >
>> > Microsoft VBScript runtime error '800a0005'
>> >
>> > Invalid procedure call or argument: 'GetGroups'
>> >
>> >
>> > Dim oUser 'As mnaSecurityUser
>> > Dim oDBAdapter 'As mnasecurityDBAdapter
>> > Dim group 'As mnasecurityGroup
>> >
>> > Set oUser = Server.CreateObject("mnaSecurityControl.mnasecurityUser")
>> > Set oDBAdapter =
>> > Server.CreateObject("mnaSecurityControl.mnasecurityDBAdapter")
>> >
>> > Set oUser = oDBAdapter.GetUser("mamarsha")
>> > 'This works ok
>> > Response.Write "'" & oUser.FirstName & "'"
>> >
>> > 'This line returns the error
>> > Set oUser.Groups = oDBAdapter.GetGroups(oUser)
>> >
>> > For each group in oUser.Groups
>> > Response.Write "'" & group.name & "'"
>> > Next
>> >
>> > GetGroups is a method that accepts an mnasecurityUser object as a
>> > parameter. Groups (in oUser.Groups) is a collection object property of
> the
>> > mnasecurityUser object.
>> >
>>
>>
>
>