Print Page | Close Window

vbscript error

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=8162
Printed Date: 01 April 2026 at 4:22am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: vbscript error
Posted By: pathan
Subject: vbscript error
Date Posted: 17 December 2003 at 10:00am

Hi, new to ASP, just working thru a book.

When I input some data onto a from and hit insert, I get an error which reads:-

Microsoft VBScript compilation error '800a03ee'

Expected ')'

line 33

Cmd.Prameters.Append Cmd.CreateParameter("?",adVarWChar, adParamInput, 50,Frist Name)

Any ideas...I have checked the code and there are no misplaced ')' anywhere.

Thanks




Replies:
Posted By: aalavar
Date Posted: 17 December 2003 at 10:26am

Try looking at the few lines before that as well.

Also is the "Cmd.Prameters.Append" a typo?  Shouldn't it be Cmd.Parameters.Append?



Posted By: MorningZ
Date Posted: 17 December 2003 at 11:15am

Cmd.Prameters.Append Cmd.CreateParameter("?",adVarWChar, adParamInput, 50,Frist Name)

the problem is: Frist Name

it has no clue what to do with that.. it should be in quotes if its a string or not have spaces in it if its a variable



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: pathan
Date Posted: 18 December 2003 at 8:02am

Hi, thanks for the info.

the problem was with the First Name...but now when I enter the details on the web site I get "No values given for one or more required parameters" and I have entered all the fields(there's only 3 fields)....I know it's impossible to know what the problem is unless you see the code. If you're really interested in looking at the code then please let me know and I'll cut and paste it here..

Thanks



Posted By: MorningZ
Date Posted: 18 December 2003 at 8:06am
Originally posted by pathan pathan wrote:

If you're really interested in looking at the code then please let me know and I'll cut and paste it here..


do it



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: pathan
Date Posted: 18 December 2003 at 8:23am

for inserting records

<!--#include file="easyasp_dbconn.asp"-->
<!--#include file="easyasp_adovbs.asp"-->
<html><head><title>New record</title><link rel="stylesheet" href="Easyasp.css" type="text/css" /></head><body leftmargin="10" rightmargin="10" bottommargin="10" topmargin="10" bgcolor="#FFFFFF"><form name="AutoForm" method="POST" enctype="" action="Students_DBInsert.asp">
<%

%>

 

<input type=hidden value="<%=Request.QueryString("easy_Page")%>" name="easy_Page">
<input type=hidden value="<%=Request.QueryString("easy_Buscar")%>" name="easy_Buscar">
<input type=hidden value="<%=Request.QueryString("easy_orderby")%>" name="easy_orderby">
<input type=hidden value="<%=Request.QueryString("easy_orderby_order")%>" name="easy_orderby_order">
<span class="Titulo">New record</span><hr width="100%" size="1" color="#4490D1" /><table cellpadding="4" cellspacing="0" border="0" align="center"><tr><td class="Normal" align="right" valign="top">First Name</td><td class="Normal" valign="top"><input class="Plano" name="First Name" type="text" maxlength="" /></td></tr><tr><td class="Normal" align="right" valign="top">Last Name</td><td class="Normal" valign="top"><input class="Plano" name="Last Name" type="text" maxlength="" /></td></tr><tr><td class="Normal" align="right" valign="top">Student Number</td><td class="Normal" valign="top"><input class="Plano" name="Student Number" type="text" maxlength="" /></td></tr><tr><td class="Normal" align="right" valign="top">Athens Username</td><td class="Normal" valign="top"><input class="Plano" name="Athens Username" type="text" maxlength="" /></td></tr><tr><td valign="top" colspan="2" align="center"><input class="Boton" type="submit" value="   Insert   " /></td></tr></table></form><di v class="Normal" align="center"><a class="Normal" href="javascript:history.back()">Back</a></div&g t;<br /><br />
<%
objConn.Close
set objConn=nothing
%>
<br/>
 </body></html>

Once this is run I get the error message

if you can log into the site then please do so at http://khan2/tvu/athens/students_insertform.asp - http://khan2/tvu/athens/students_insertform.asp

this is the code that it looks at when the submit button is clicked

<!--#include file="easyasp_dbconn.asp"-->
<!--#include file="easyasp_adovbs.asp"-->

<%
on error resume next
Errores=""

easy_Page=Request("easy_Page")
easy_Buscar=Request("easy_Buscar")
easy_orderby=Request("easy_orderby")
easy_orderby_order=Request("easy_orderby_order")

First Name=Request("First Name")


Last Name=Request("Last Name")


Student Number=Request("Student Number")


Athens Username=Request("Athens Username")

 

if Errores="" then

    set Cmd=server.createobject("adodb.command")
    Cmd.activeconnection=objConn
    Cmd.commandtype=adCmdText
    Cmd.commandtext="insert into Students(First Name,Last Name,Student Number,Athens Username) values(?,?,?,?)"

    Cmd.Parameters.Append Cmd.CreateParameter("?",adVarWChar, adParamInput, 50,"First Name")
    Cmd.Parameters.Append Cmd.CreateParameter("?",adVarWChar, adParamInput, 50,"Last Name")
    Cmd.Parameters.Append Cmd.CreateParameter("?",adInteger, adParamInput, 8,"Student Number")
    Cmd.Parameters.Append Cmd.CreateParameter("?",adVarWChar, adParamInput, 50,"Athens Username")

    Cmd.Execute
    set cmd=nothing
    if err.number<>0 then
        Errores=Errores&Err.Description&"<br>"
    end if

    objConn.Close
    set objConn=nothing
    if Errores="" then
        Response.Redirect("Students_List.asp?easy_Page=" & easy_Page & "&easy_Buscar=" & easy_Buscar & "&easy_orderby=" & easy_orderby & "&easy_orderby_order=" & easy_orderby_order)
    end if

end if
if Errores<>"" then%>
 
<html><head><title>Error</title>
<link rel="stylesheet" href="Easyasp.css" type="text/css" />
</head>
<body leftmargin="10" rightmargin="10" bottommargin="10" topmargin="10" bgcolor="#FFFFFF">
    <%Response.Write("<div class=""Normal"" align=""center""><br><strong>The following errors were founded while inserting the record</strong><br><br>")
    Response.Write("<span class=""Error"">")
    Response.Write(Errores)
    Response.Write("</span>")
    Response.Write("<br><br><a class=""Normal"" href=""javascript:history.back()"">click here to go back</a></div><br>")
    %>
 
    <%objConn.Close
    set objConn=nothing
end if
%>

Thanks..



Posted By: MorningZ
Date Posted: 18 December 2003 at 9:10am

well, i'll start off by giving you advice that spaces in column names in any database is not good design, and causes issues (as you are running into)

one fix might be:

insert into Students([First Name],[Last Name],[Student Number],[Athens Username]) values(?,?,?,?)"

and this is not legal one single bit:

First Name=Request("First Name")

you cannot have spaces in variable names.. so by fixing the variable first

FirstName = Request("First Name")

then fixing the adding of the command parameter

Cmd.Parameters.Append Cmd.CreateParameter("?",adVarWChar, adParamInput, 50, FirstName)



-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: pathan
Date Posted: 19 December 2003 at 3:31am

Hi "MorningZ", thanks for the info, but I an having no luck. I have taken out the spaces and corrected the syntax and still it doesn't work...maybe I should give up.

ps did you manage to log into the site?




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net