Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: help ! SQL syntax error


Message #1 by "Dillon" <bacsr@c...> on Sun, 22 Apr 2001 15:54:18 +0800
Hello,

I am trying to spot the code below, and I still unable to figure out for the

whole day.

Can someone please advise?  It would be greatly appreciated.



Here are the error message showed:

Syntax error (missing operator) in query expression 'where Postion = 'System

Analyst''.



and the SQL statement:

SQL = "Select JoborderID from Joborder where " &_

      "where Postion = '" & Session("Choice1") & "';"



Dillon.



Message #2 by "Dallas Martin" <dmartin@z...> on Sun, 22 Apr 2001 08:35:02 -0400
Should you change "POSTION" to "POSITION"?

Just a guess!!







----- Original Message -----

From: "Dillon" <bacsr@c...>

To: "ASP Databases" <asp_databases@p...>

Sent: Sunday, April 22, 2001 3:54 AM

Subject: [asp_databases] help ! SQL syntax error





> Hello,

> I am trying to spot the code below, and I still unable to figure out for

the

> whole day.

> Can someone please advise?  It would be greatly appreciated.

>

> Here are the error message showed:

> Syntax error (missing operator) in query expression 'where Postion 

'System

> Analyst''.

>

> and the SQL statement:

> SQL = "Select JoborderID from Joborder where " &_

>       "where Postion = '" & Session("Choice1") & "';"

>

> Dillon.

>

>



Message #3 by "Tomm Matthis" <matthis@b...> on Sun, 22 Apr 2001 09:10:18 -0400
You have two WHERE 's in the string ...



Hope that helps.



Tomm



> -----Original Message-----

> From: Dillon [mailto:bacsr@c...]

> Sent: Sunday, April 22, 2001 3:54 AM

> To: ASP Databases

> Subject: [asp_databases] help ! SQL syntax error

> 

> 

> Hello,

> I am trying to spot the code below, and I still unable to figure 

> out for the

> whole day.

> Can someone please advise?  It would be greatly appreciated.

> 

> Here are the error message showed:

> Syntax error (missing operator) in query expression 'where 

> Postion = 'System

> Analyst''.

> 

> and the SQL statement:

> SQL = "Select JoborderID from Joborder where " &_

>       "where Postion = '" & Session("Choice1") & "';"

> 

> Dillon.

> 

> 

> ---

> SoftArtisans helps developers build robust, scalable Web applications!

> Excel Web reports, charts: http://www.softartisans.com/excelwriter.html

> File uploads: http://www.softartisans.com/saf.html

> Transactional file management: http://www.softartisans.com/saf1.html

> Scalability: http://www.softartisans.com/saxsession.html

> ASPstudio value pack: http://www.softartisans.com/aspstudiosuite.html




> $subst('Email.Unsub')

> 

> 

Message #4 by "Charles Feduke" <webmaster@r...> on Sun, 22 Apr 2001 18:35:58 -0400
> SQL = "Select JoborderID from Joborder where " &_

>       "where Postion = '" & Session("Choice1") & "';"



    You've got "where" in there twice (once on the first line, once on the

second).  Try it with one WHERE.



- Chuck



Message #5 by "ASPCoder123" <sahmer@n...> on Mon, 23 Apr 2001 21:52:32
Hi,



Hi I think you are having "WHERE" repeated Twice in your statement, one 

more tip, when comparing the Value with Sql Like "Where name='a'" use the 

replace function before that otherwise if the user gives some criteria 

like "Where name='a''" the SQL statement will fail, the alternative 

approach would be to write statement like this 



"Where name = '" & Replace(Session("name"),"'","''")



Hope this will solve your problem.



> Hello,

> I am trying to spot the code below, and I still unable to figure out for 

the

> whole day.

> Can someone please advise?  It would be greatly appreciated.

> 

> Here are the error message showed:

> Syntax error (missing operator) in query expression 'where Postion 

= 'System

> Analyst''.

> 

> and the SQL statement:

> SQL = "Select JoborderID from Joborder where " &_

>       "where Postion = '" & Session("Choice1") & "';"

> 

> Dillon.

> 


  Return to Index