Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: Expected end of statement (HELP!!!!)


Message #1 by "owen davies" <o2x@y...> on Thu, 23 Jan 2003 13:29:32
Hi am an ASP newbie

am getting the following error message:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/BegASP/edu.asp, line 72, column 44
strSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" & 
Request(Education)"'

here is the code (EducationID is an Autonumber in Access DB by the way)

<%
Dim blnNew
     ' detect whether the user is adding a new item or editing an 
existing one
Select Case Request.QueryString("Action")
    Case "AddNew"
      blnNew = True
    Case "Edit"
      blnNew = False
End Select

If blnNew Then 
    Response.Write _       
      "<P>Please add the following education details. "
Else 
    Response.Write _ 
      
      "<P>Please edit your education details. "
      
    Dim rsEducation
    Set rsEducation = Server.CreateObject("ADODB.Recordset")
    strSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" 
& Request(Education)"'
    rsEducation.Open strSQL, objConn, adOpenForwardOnly, 
adLockOptimistic, adCmdText 
      End If

%>
Message #2 by "Thomas, Dean" <Dean.Thomas@u...> on Thu, 23 Jan 2003 08:41:19 -0500
Owen,
It looks like the end of your SQL statement needs repair...

strSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" 
& Request(Education) & "'"

As Ken always recommends, try adding a Response.write statement before doing
the query and you will then be able to see what your actual SQL statement is
with the Request included.
All for now.
Dean

-----Original Message-----
From: owen davies [mailto:o2x@y...]
Sent: Thursday, January 23, 2003 8:30 AM
To: Access ASP
Subject: [access_asp] Expected end of statement (HELP!!!!)


Hi am an ASP newbie

am getting the following error message:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/BegASP/edu.asp, line 72, column 44
strSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" & 
Request(Education)"'

here is the code (EducationID is an Autonumber in Access DB by the way)

<%
Dim blnNew
     ' detect whether the user is adding a new item or editing an 
existing one
Select Case Request.QueryString("Action")
    Case "AddNew"
      blnNew = True
    Case "Edit"
      blnNew = False
End Select

If blnNew Then 
    Response.Write _       
      "<P>Please add the following education details. "
Else 
    Response.Write _ 
      
      "<P>Please edit your education details. "
      
    Dim rsEducation
    Set rsEducation = Server.CreateObject("ADODB.Recordset")
    strSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" 
& Request(Education)"'
    rsEducation.Open strSQL, objConn, adOpenForwardOnly, 
adLockOptimistic, adCmdText 
      End If

%>
Message #3 by =?iso-8859-1?q?Owen=20Davies?= <o2x@y...> on Thu, 23 Jan 2003 13:53:42 +0000 (GMT)
Thanks for the prompt reply, Ive now changed the code
to:

strSQL = "SELECT * FROM Education WHERE
Education.EducationID=" & CLng(Request(Education))

but now get this error:

Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has
been deleted. Requested operation requires a current
record.
/BegASP/edu.asp


 --- "Thomas, Dean" <Dean.Thomas@u...> wrote:
> Owen,
> It looks like the end of your SQL statement needs
> repair...
> 
> strSQL = "SELECT * FROM Education " & WHERE
> Education.EducationID='" 
> & Request(Education) & "'"
> 
> As Ken always recommends, try adding a
> Response.write statement before doing
> the query and you will then be able to see what your
> actual SQL statement is
> with the Request included.
> All for now.
> Dean
> 
> -----Original Message-----
> From: owen davies [mailto:o2x@y...]
> Sent: Thursday, January 23, 2003 8:30 AM
> To: Access ASP
> Subject: [access_asp] Expected end of statement
> (HELP!!!!)
> 
> 
> Hi am an ASP newbie
> 
> am getting the following error message:
> 
> Error Type:
> Microsoft VBScript compilation (0x800A0401)
> Expected end of statement
> /BegASP/edu.asp, line 72, column 44
> strSQL = "SELECT * FROM Education " & WHERE
> Education.EducationID='" & 
> Request(Education)"'
> 
> here is the code (EducationID is an Autonumber in
> Access DB by the way)
> 
> <%
> Dim blnNew
>      ' detect whether the user is adding a new item
> or editing an 
> existing one
> Select Case Request.QueryString("Action")
>     Case "AddNew"
>       blnNew = True
>     Case "Edit"
>       blnNew = False
> End Select
> 
> If blnNew Then 
>     Response.Write _       
>       "<P>Please add the following education
> details. "
> Else 
>     Response.Write _ 
>       
>       "<P>Please edit your education details. "
>       
>     Dim rsEducation
>     Set rsEducation 
> Server.CreateObject("ADODB.Recordset")
>     strSQL = "SELECT * FROM Education " & WHERE
> Education.EducationID='" 
> & Request(Education)"'
>     rsEducation.Open strSQL, objConn,
> adOpenForwardOnly, 
> adLockOptimistic, adCmdText 
>       End If
> 
> %>
> 

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Message #4 by "Schelling, Michael" <schellim@s...> on Thu, 23 Jan 2003 11:33:36 -0500
If this is your complete file I don't see where you get the value for
Request(Education).  If this is not your complete file can you post it. 

-----Original Message-----
From: owen davies [mailto:o2x@y...]
Sent: Thursday, January 23, 2003 8:30 AM
To: Access ASP
Subject: [access_asp] Expected end of statement (HELP!!!!)


Hi am an ASP newbie

am getting the following error message:

Error Type:
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/BegASP/edu.asp, line 72, column 44
strSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" & 
Request(Education)"'

here is the code (EducationID is an Autonumber in Access DB by the way)

<%
Dim blnNew
     ' detect whether the user is adding a new item or editing an 
existing one
Select Case Request.QueryString("Action")
    Case "AddNew"
      blnNew = True
    Case "Edit"
      blnNew = False
End Select

If blnNew Then 
    Response.Write _       
      "<P>Please add the following education details. "
Else 
    Response.Write _ 
      
      "<P>Please edit your education details. "
      
    Dim rsEducation
    Set rsEducation = Server.CreateObject("ADODB.Recordset")
    strSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" 
& Request(Education)"'
    rsEducation.Open strSQL, objConn, adOpenForwardOnly, 
adLockOptimistic, adCmdText 
      End If

%>
Message #5 by "Lori Gudenkauf" <LoriLGudenkauf@u...> on Fri, 24 Jan 2003 08:44:40
Anytime I get 'expected end of statement' its a missing quotation 
mark...   Looks to me like there should be a quotation mark before the 
word WHERE ...and I THINK before the word Request...   and not so sure 
what you're doing at the end of that line...    but check all your 
quotation mark placements

> Hi am an ASP newbie

> am getting the following error message:

> Error Type:
M> icrosoft VBScript compilation (0x800A0401)
E> xpected end of statement
/> BegASP/edu.asp, line 72, column 44
s> trSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" & 
R> equest(Education)"'

> here is the code (EducationID is an Autonumber in Access DB by the way)

> <%
D> im blnNew
 >     ' detect whether the user is adding a new item or editing an 
e> xisting one
S> elect Case Request.QueryString("Action")
 >    Case "AddNew"
 >      blnNew = True
 >    Case "Edit"
 >      blnNew = False
E> nd Select

> If blnNew Then 
 >    Response.Write _       
 >      "<P>Please add the following education details. "
E> lse 
 >    Response.Write _ 
 >      
 >      "<P>Please edit your education details. "
 >      
 >    Dim rsEducation
 >    Set rsEducation = Server.CreateObject("ADODB.Recordset")
 >    strSQL = "SELECT * FROM Education " & WHERE Education.EducationID='" 
&>  Request(Education)"'
 >    rsEducation.Open strSQL, objConn, adOpenForwardOnly, 
a> dLockOptimistic, adCmdText 
 >      End If

> %>
Message #6 by "Thomas, Dean" <Dean.Thomas@u...> on Fri, 24 Jan 2003 09:15:02 -0500
Owen,
I would start by simply doing a strSQL = "Select * from Education". If this
works then I would try hard coding a value into the SQL statement for the
Education.EducationID. If you do not get the same error message then there
is something wrong with you Request variable being introduced. In either
case if you get the same error then I would guess there is something wrong
with the way the DB is being opened; Kens website "adOpenStatic" no doubt
would have some help or pointers in that area if that is the case.
All for now.
Dean 

-----Original Message-----
From: Owen Davies [mailto:o2x@y...]
Sent: Thursday, January 23, 2003 8:54 AM
To: Access ASP
Subject: [access_asp] RE: Expected end of statement (HELP!!!!)


Thanks for the prompt reply, Ive now changed the code
to:

strSQL = "SELECT * FROM Education WHERE
Education.EducationID=" & CLng(Request(Education))

but now get this error:

Error Type:
ADODB.Field (0x80020009)
Either BOF or EOF is True, or the current record has
been deleted. Requested operation requires a current
record.
/BegASP/edu.asp


 --- "Thomas, Dean" <Dean.Thomas@u...> wrote:
> Owen,
> It looks like the end of your SQL statement needs
> repair...
> 
> strSQL = "SELECT * FROM Education " & WHERE
> Education.EducationID='" 
> & Request(Education) & "'"
> 
> As Ken always recommends, try adding a
> Response.write statement before doing
> the query and you will then be able to see what your
> actual SQL statement is
> with the Request included.
> All for now.
> Dean
> 
> -----Original Message-----
> From: owen davies [mailto:o2x@y...]
> Sent: Thursday, January 23, 2003 8:30 AM
> To: Access ASP
> Subject: [access_asp] Expected end of statement
> (HELP!!!!)
> 
> 
> Hi am an ASP newbie
> 
> am getting the following error message:
> 
> Error Type:
> Microsoft VBScript compilation (0x800A0401)
> Expected end of statement
> /BegASP/edu.asp, line 72, column 44
> strSQL = "SELECT * FROM Education " & WHERE
> Education.EducationID='" & 
> Request(Education)"'
> 
> here is the code (EducationID is an Autonumber in
> Access DB by the way)
> 
> <%
> Dim blnNew
>      ' detect whether the user is adding a new item
> or editing an 
> existing one
> Select Case Request.QueryString("Action")
>     Case "AddNew"
>       blnNew = True
>     Case "Edit"
>       blnNew = False
> End Select
> 
> If blnNew Then 
>     Response.Write _       
>       "<P>Please add the following education
> details. "
> Else 
>     Response.Write _ 
>       
>       "<P>Please edit your education details. "
>       
>     Dim rsEducation
>     Set rsEducation 
> Server.CreateObject("ADODB.Recordset")
>     strSQL = "SELECT * FROM Education " & WHERE
> Education.EducationID='" 
> & Request(Education)"'
>     rsEducation.Open strSQL, objConn,
> adOpenForwardOnly, 
> adLockOptimistic, adCmdText 
>       End If
> 
> %>
> 

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


  Return to Index