Wrox Programmer Forums
|
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
 
Old February 9th, 2004, 02:20 AM
Registered User
 
Join Date: Feb 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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...
 
Old February 9th, 2004, 03:41 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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.
 
Old February 10th, 2004, 12:29 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Or you can include the Call keyword before calls to subroutines:

Call Add_user(Name, Email, Division, username, pwd)

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft VBScript compilation (0x800A0400) joeyjoejnr Classic ASP Databases 2 May 9th, 2007 03:22 AM
Microsoft VBScript compilation (0x800A03F6) ahmedonline5 Classic ASP Basics 1 March 12th, 2007 07:33 AM
Microsoft VBScript compilation (0x800A0400) davidclangley ASP.NET 2.0 Basics 0 February 11th, 2007 10:46 AM
Microsoft VBScript compilation (0x800A03EA) srm_kumar ASP.NET 1.0 and 1.1 Basics 1 November 10th, 2006 01:42 PM
Microsoft VBScript compilation (0x800A0400) cnottingham Classic ASP Databases 2 February 12th, 2004 10:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.