 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

February 9th, 2004, 02:20 AM
|
|
Registered User
|
|
Join Date: Feb 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Microsoft VBScript compilation (0x800A0414)
Iam Using SQL Server as Database.
I have function defined in a file called definedfuns.asp
--------------file code----------------------------------
<%
'--------------------- Function to add new users-----------------------
Function Add_user(Name, Email, Division, username, pwd)
dim dbConn,rs
set dbConn = GetDataConnection
set rs = server.createobject("adodb.recordset")
rs.open "users_info", dbConn, 2, 2
'Use the addnew method of the recordset object to add a record
rs.addnew
'Set the table column = to my input text box from my form
rs("Name") = Name
rs("Email") = Email
rs("Division") = Division
rs("username") = username
rs("pwd") = pwd
rs.update
'I do a movelast here to get the ID that is automatically generated
'I also set the value to a local variable so I can write out to the database
rs.movelast
dim uno
uno = rs("user_no")
if uno <> " " then
Response.write "<b>User Added Sucessfully</b>"
else
Response.write "<b>Problem Encountered...</b>"
end if
End Function
%>
---------------------------------------
I am calling this function in newuser.asp, iam pasting only the code which is giving error from newuser.asp.
-----------------File Code------------------------------------
<%
if Request("AddUser") <> "" then
Dim Name,Email,Division,username,pwd
Name = TRIM(Request("requiredname"))
Email = TRIM(Request("requiredemail"))
Division = TRIM(Request("requireddivision"))
username = TRIM(Request("requiredusername"))
pwd = TRIM(Request("requiredpwd"))
Add_user(Name, Email, Division, username, pwd)
end if
%>
Error Message :Microsoft VBScript compilation (0x800A0414)
Cannot use parentheses when calling a Sub
/flash/HRResume/Newuser.asp, line 176, column 46
Add_user(Name, Email, Division, username, pwd)
---------------------------------------------^
Syed...
|
|

February 9th, 2004, 03:41 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
In VBScript, you can't use the parentheses around the parameter list when you call a Sub. So, change:
Add_user(Name, Email, Division, username, pwd)
to
Add_user Name, Email, Division, username, pwd
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|

February 10th, 2004, 12:29 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Or you can include the Call keyword before calls to subroutines:
Call Add_user(Name, Email, Division, username, pwd)
Peter
------------------------------------------------------
Work smarter, not harder.
|
|
 |