473,785 Members | 2,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 mnasecurityDBAd apter
Dim group 'As mnasecurityGrou p

Set oUser = Server.CreateOb ject("mnaSecuri tyControl.mnase curityUser")
Set oDBAdapter =
Server.CreateOb ject("mnaSecuri tyControl.mnase curityDBAdapter ")

Set oUser = oDBAdapter.GetU ser("mamarsha")
'This works ok
Response.Write "'" & oUser.FirstName & "'"

'This line returns the error
Set oUser.Groups = oDBAdapter.GetG roups(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 6231
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
mnasecurityGrou ps

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 mnasecurityGrou ps

From my Asp page I updated the following line of code

Set oUser.Groups = oDBAdpater.GetU sers(oUser)

to

Set oUser.Groups = oDBAdpater.GetU sers(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******@newsg roups.nospam> wrote in message
news:ux******** ******@TK2MSFTN GP02.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 mnasecurityDBAd apter
Dim group 'As mnasecurityGrou p

Set oUser = Server.CreateOb ject("mnaSecuri tyControl.mnase curityUser")
Set oDBAdapter =
Server.CreateOb ject("mnaSecuri tyControl.mnase curityDBAdapter ")

Set oUser = oDBAdapter.GetU ser("mamarsha")
'This works ok
Response.Write "'" & oUser.FirstName & "'"

'This line returns the error
Set oUser.Groups = oDBAdapter.GetG roups(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******@newsg roups.nospam> wrote in message
news:%2******** ********@TK2MSF TNGP05.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
mnasecurityGrou ps

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 mnasecurityGrou ps

From my Asp page I updated the following line of code

Set oUser.Groups = oDBAdpater.GetU sers(oUser)

to

Set oUser.Groups = oDBAdpater.GetU sers(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******@newsg roups.nospam> wrote in message
news:ux******** ******@TK2MSFTN GP02.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 mnasecurityDBAd apter
Dim group 'As mnasecurityGrou p

Set oUser = Server.CreateOb ject("mnaSecuri tyControl.mnase curityUser")
Set oDBAdapter =
Server.CreateOb ject("mnaSecuri tyControl.mnase curityDBAdapter ")

Set oUser = oDBAdapter.GetU ser("mamarsha")
'This works ok
Response.Write "'" & oUser.FirstName & "'"

'This line returns the error
Set oUser.Groups = oDBAdapter.GetG roups(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******@newsg roups.nospam> wrote in message
news:%2******** ********@TK2MSF TNGP05.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
mnasecurityGrou ps

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 mnasecurityGrou ps

From my Asp page I updated the following line of code

Set oUser.Groups = oDBAdpater.GetU sers(oUser)

to

Set oUser.Groups = oDBAdpater.GetU sers(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******@newsg roups.nospam> wrote in message
news:ux******** ******@TK2MSFTN GP02.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 mnasecurityDBAd apter
Dim group 'As mnasecurityGrou p

Set oUser = Server.CreateOb ject("mnaSecuri tyControl.mnase curityUser")
Set oDBAdapter =
Server.CreateOb ject("mnaSecuri tyControl.mnase curityDBAdapter ")

Set oUser = oDBAdapter.GetU ser("mamarsha")
'This works ok
Response.Write "'" & oUser.FirstName & "'"

'This line returns the error
Set oUser.Groups = oDBAdapter.GetG roups(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****@dontbot herme.zzz> wrote in message
news:uv******** ******@TK2MSFTN GP03.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******@newsg roups.nospam> wrote in message
news:%2******** ********@TK2MSF TNGP05.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
mnasecurityGrou ps

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 mnasecurityGrou ps

From my Asp page I updated the following line of code

Set oUser.Groups = oDBAdpater.GetU sers(oUser)

to

Set oUser.Groups = oDBAdpater.GetU sers(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******@newsg roups.nospam> wrote in message
news:ux******** ******@TK2MSFTN GP02.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 mnasecurityDBAd apter
> Dim group 'As mnasecurityGrou p
>
> Set oUser = Server.CreateOb ject("mnaSecuri tyControl.mnase curityUser")
> Set oDBAdapter =
> Server.CreateOb ject("mnaSecuri tyControl.mnase curityDBAdapter ")
>
> Set oUser = oDBAdapter.GetU ser("mamarsha")
> 'This works ok
> Response.Write "'" & oUser.FirstName & "'"
>
> 'This line returns the error
> Set oUser.Groups = oDBAdapter.GetG roups(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******@newsg roups.nospam> wrote in message
news:eI******** ******@TK2MSFTN GP04.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
6016
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 stored procedures. So far ive been able to move the functions relatively easily but im unsure about how to output multiple values from an sql stored procedure. By this i mean for example one of the stored procedures may take your username and return...
3
2793
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 trigger!! i.e the trigger performs no action, but because there is no error, this can
1
2601
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 general group note on a form, click a button, and have that note stored in the memo field for each person's appointment record. I created a form with an unbound field called GroupNote. I then run an update query that updates the note field for all...
6
29942
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 newsgroups, the access support centre, I can seem to find no similar situation. I am not using any references, or VBA at all in the first place. I am trying to set up a simple (or so I thought) query to work with the text of two tables. ...
2
2238
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 cast exception error: Compiler Error Message: BC30311: Value of type 'Date' cannot be converted to 'Integer'. The real problem here is that the type in the database and the stored prcedure aren't integers at all rather they are datetime...
1
2975
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 use under Window 95 or Window 98 it will work fine with no error. the code we use is as follow LabelPN = App.path & "\LabelTmp.txt" Open LabelPN For Output As #1 Print #1, strLabel Close #1 AppActivate Shell(App.path & "\PrintLBL.pif",...
5
5359
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 schema1.emp ( fname varchar(15) not null, lname varchar(15) not null, dob date,
25
62568
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 Files\Internet Explorer\Iexplore.exe http://www.google.ca", vbMaximizedFocus) End Sub i have a program thats been on my desktop for about a month now that uses these 3 lines of code(supposed to be 3 lines but it doesnt quite fit) and its been...
8
1644
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 one in the procedure that's about to be called. If we let in an invalid parameter, we'll get the following error message. Msg 8145, Level 16, State 1, Procedure Prc, Line 0 @Param is not a parameter for procedure Prc.
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10148
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.