Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - vbscript error
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

vbscript error

 Post Reply Post Reply
Author
pathan View Drop Down
Newbie
Newbie


Joined: 17 December 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote pathan Quote  Post ReplyReply Direct Link To This Post Topic: vbscript error
    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

Back to Top
aalavar View Drop Down
Groupie
Groupie


Joined: 08 December 2003
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote aalavar Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pathan View Drop Down
Newbie
Newbie


Joined: 17 December 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote pathan Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pathan View Drop Down
Newbie
Newbie


Joined: 17 December 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote pathan Quote  Post ReplyReply Direct Link To This Post 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

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..

Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pathan View Drop Down
Newbie
Newbie


Joined: 17 December 2003
Status: Offline
Points: 4
Post Options Post Options   Thanks (0) Thanks(0)   Quote pathan Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.