wrong number of arguments error??

  • Thread starter Thread starter diggsy
  • Start date Start date
D

diggsy

Guest
Hi,

I'm trying to query an Access database with an asp page hit with a hidden form from an ecommerce site. It was working fine until I added a new variable ("speed"), and now I get the following error:

Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'updateUser'
/purchase_proc.asp, line 47


Line 47 of purchase_proc.asp is the following:


call updateUser(session("userid"),session("name"),session("pass"),firstname,lastname,address1,address2,city,state,zip,country,phone,email,message,views,speed)


And it comes from a jscript function as follows:


Function updateUser(userid,name,pass,firstname,lastname,address1,address2,city,state,zip,country,phone,email,message,views,speed)
sql = "UPDATE users SET "
sql = sql & "name = '" & name & "', "
sql = sql & "pass = '" & pass & "', "
sql = sql & "firstname = '" & firstname & "', "
sql = sql & "lastname = '" & lastname & "', "
sql = sql & "address1 = '" & address1 & "', "
sql = sql & "address2 = '" & address2 & "', "
sql = sql & "city = '" & city & "', "
sql = sql & "state = '" & state & "', "
sql = sql & "zip = '" & zip & "', "
sql = sql & "country = '" & country & "', "
sql = sql & "phone = '" & phone & "', "
sql = sql & "email = '" & email & "', "
sql = sql & "message = '" & message & "', "
sql = sql & "views = " & views & " "
sql = sql & "speed = '" & speed & "', "
sql = sql & "WHERE userid = " & userid & ";"
Set DBConn8 = Server.CreateObject("ADODB.Connection")
DBConn8.Open getDbCon()
Set oRS8 = DBConn8.Execute(sql)
if DBConn8.errors.count> 0 then
for counter = 0 to DBConn8.errors.count
response.write "Database Error #" & DBConn8.errors(counter).number & " -> " & DBConn8.errors(counter).description & "<br>"
next
end if
session("expires") = expires
set DBConn8 = nothing
End Function


Like I said, since I added "speed", I've been getting this worng number of arguments error. But as far as I can see the arguments with the call and the function are the same. I'm at a loss, mostly because I'm a newbie with asp, access, and the script languages. Any suggestions will be helpful. Thanks
 
you wrote
<<
sql = sql & "views = " & views & " "
sql = sql & "speed = '" & speed & "', "
>>

looks like the problem is the "views" line. No comma.

RichM
 
You also have a comma after Speed which should not be there.
 
Hi guys.

Thanks for trying, but no luck so far. I've changed those two lines to read

sql = sql & "views = '" & views & "', "
sql = sql & "speed = " & speed & " "

but I still get the same error.

When I take away the speed variable in purchase_proc.asp and it looks like this

call updateUser(session("userid"),session("name"),session("pass"),firstname,lastname,address1,address2,city,state,zip,country,phone,email,message,views)

there is no error, but it does not post the speed to Access.
Is there any other way the number of arguments could be put out of wack?
 
I don't know asp so I'm over my head here but what is "updateUser" and does it need to be compiled or something to make it recognize a new field?
 
Another guess.

In your script in the asp page, have you allocated a variable for "speed" ? In VBscript it is a "dim". Don't know what it is in Jscript.

RichM
 
Pat: updateUser is a javascript function, but I'm not sure if it needs to be compiled or not. I'm guessing not because it all works fine without the "speed" variable. I am also over my head with all of this. Someone else wrote this application for my site, and now I'm trying to customize it by myself (the programmer is no longer involved).

Rich: The javascript functions actually sit in a separate file with a reference to them in the asp page, but yes, the "speed" variable has been allocated with all the others in the jscript file.

still lookin
 
As far as I know script functions do not require any recompile when changed. This is true for VBscript and I am pretty sure Jscript is the same.

RichM
 

Users who are viewing this thread

Back
Top Bottom