473,394 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Invalid Procedure Call or Arguement

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.mnasecurit yUser")
Set oDBAdapter =
Server.CreateObject("mnaSecurityControl.mnasecurit yDBAdapter")

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.
May 5 '06 #1
5 6183
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" <ma******@newsgroups.nospam> wrote in message
news:ux**************@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.mnasecurit yUser")
Set oDBAdapter =
Server.CreateObject("mnaSecurityControl.mnasecurit yDBAdapter")

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.

May 5 '06 #2
> Does anyone know why I can't pass an object as a parameter

By 'parameter', I assume you mean argument.

You can pass objects to Subs and Functions in VBScript. What you can't do,
is declare the type for the Function / Sub argument.

No -
Public Function GetUsers(ByRef oUser as mnasecurityUser)

Yes -
Public Function GetUsers(ByRef oUser)

Bob Lehmann

"Matt" <ma******@newsgroups.nospam> wrote in message
news:%2****************@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" <ma******@newsgroups.nospam> wrote in message
news:ux**************@TK2MSFTNGP02.phx.gbl...
I am receiving the following error from the simple script below. This worksfine from a .NET form but when I access the dll from a Classic ASP page itfails.

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.mnasecurit yUser")
Set oDBAdapter =
Server.CreateObject("mnaSecurityControl.mnasecurit yDBAdapter")

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.


May 5 '06 #3
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" <ma******@newsgroups.nospam> wrote in message
news:%2****************@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" <ma******@newsgroups.nospam> wrote in message
news:ux**************@TK2MSFTNGP02.phx.gbl...
I am receiving the following error from the simple script below. This worksfine from a .NET form but when I access the dll from a Classic ASP page itfails.

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.mnasecurit yUser")
Set oDBAdapter =
Server.CreateObject("mnaSecurityControl.mnasecurit yDBAdapter")

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.


May 5 '06 #4

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" <no****@dontbotherme.zzz> wrote in message
news:uv**************@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" <ma******@newsgroups.nospam> wrote in message
news:%2****************@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" <ma******@newsgroups.nospam> wrote in message
news:ux**************@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.mnasecurit yUser")
> Set oDBAdapter =
> Server.CreateObject("mnaSecurityControl.mnasecurit yDBAdapter")
>
> 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.
>



May 5 '06 #5

"Matt" <ma******@newsgroups.nospam> wrote in message
news:eI**************@TK2MSFTNGP04.phx.gbl...

Thanks Bob.

If I set the argument to VariantType in my function, how can I then access
the object properties in the function?


Your real problem is the use of a ByRef. The only argument that VBScript
can pass byref is a variant.

Change the parameter to ByVal oUser as mnasecurityUser. You really should
use ByVal for most parameters anyway regardless of whether they are to be
called from script or not.

Anthony.
May 5 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Jarrod Morrison | last post by:
Hi All Im generally a vb programmer and am used to referencing multiple records returned from a query performed on an sql database and im trying to move some functions of my software into sql...
3
by: Paul Reddin | last post by:
Hi, FYI & comment: We have triggers that call SPs. If the Stored Procedure is invalidated, e.g a dependent table is dropped. The SP is marked as invalid, but no error is thrown by the...
1
by: j.mandala | last post by:
I have a memo field in an appointment application that stores session notes for group psychotherapy sessions. Each attendee of the group has an appointment record. I want to be able to write a...
6
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
2
by: adams114 | last post by:
I am having a strange problem with invalid type casts. I am trying to update a MS SQL Database with a stored procedure. When I setup the parameters collection for the command object I get a invalid...
1
by: Terry | last post by:
Hi. We had a in-house program that use a PRINTLBL.EXE to print label in DOS mode. after the label was printed, Window XP will issue the error message ( Invalid procedure call or arguments ). But if...
5
by: wpellett | last post by:
I can not get the SQL compiler to rewrite my SQL UPDATE statement to include columns being SET in a Stored Procedure being called from a BEFORE UPDATE trigger. Example: create table...
25
by: dennijr | last post by:
ok, shell always used to be easy for me, now its starting to get annoying cause i dont know wats wrong heres the simplist code possible: Private Sub IExplorer_Click() a = Shell("C:\Program...
8
by: K Viltersten | last post by:
I've seen some people calling a stored procedure on MS SQL Server and intercepting an invalid parameter list by a switch statement, demanding that each of the parameters names is exactly as the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.