Groups | Blog | Home
all groups > inetserver asp db > september 2003 >

inetserver asp db : Syntax error (missing operator) in query expression'idProperty='


Atrax
9/28/2003 2:12:05 AM
do this :

strSQL = "UPDATE tblRentalProperty SET " _
& "tblPropertyType = '" & tblPropertyType & "', " _
& "tblRooms ='" & tblRooms & "', " _
& "tblWeeklyPrice = '" & tblWeeklyPrice & "', " _
& "tblImage = '" & tblImage & "', " _
& "tblBriefDescription = '" & tblBriefDescription & "', " _
& "tblDetailedDescription = '" & tblDetailedDescription & "', " _
& "tblStatus = '" & tblStatus & "', " _
& "tblAddress1 = '" & tblAddress1 & "', " _
& "tblAddress2 = '" & tblAddress2 & "', " _
& "tblAddress3 = '" & tblAddress3 & "', " _
& "tblAddress4 = '" & tblAddress4 & "', " _
& "tblPostCode = '" & tblPostCode & "', " _
& "tblCountry = '" & tblCountry & "', " _
& "idArea = '" & idArea & "', " _
& "Deleted = '" & Deleted & "' WHERE " _
& "idProperty = " & ID

Response.Write strSQL
Conn.execute strSQL

that'll show you EXACTLY what's being passed to the DB - and you're more
likely to spot the error that way - a very commonly used debugging trick
and one to remember.



________________________________________
Atrax. MVP, IIS
http://rtfm.atrax.co.uk/

newsflash : Atrax.Richedit 1.0 now released.
http://rtfm.atrax.co.uk/infinitemonkeys/components/Atrax.RichEdit/

*** Sent via Developersdex http://www.developersdex.com ***
David Wapnick
9/28/2003 8:46:44 AM
The following is the code, can someone please help me with the syntax please
in the first line please

Conn.Execute "UPDATE tblRentalProperty SET " _
& "tblPropertyType = '" & tblPropertyType & "', " _
& "tblRooms ='" & tblRooms & "', " _
& "tblWeeklyPrice = '" & tblWeeklyPrice & "', " _
& "tblImage = '" & tblImage & "', " _
& "tblBriefDescription = '" & tblBriefDescription & "', " _
& "tblDetailedDescription = '" & tblDetailedDescription & "', " _
& "tblStatus = '" & tblStatus & "', " _
& "tblAddress1 = '" & tblAddress1 & "', " _
& "tblAddress2 = '" & tblAddress2 & "', " _
& "tblAddress3 = '" & tblAddress3 & "', " _
& "tblAddress4 = '" & tblAddress4 & "', " _
& "tblPostCode = '" & tblPostCode & "', " _
& "tblCountry = '" & tblCountry & "', " _
& "idArea = '" & idArea & "', " _
& "Deleted = '" & Deleted & "' WHERE " _
& "idProperty = " & ID




Ken Schaefer
9/28/2003 6:52:03 PM
a) First, allocate the string to a variable, and response.write() the value,
so you can see what's being sent to the database.

eg:

<%
strSQL = "UPDATE tblRentalProperty SET " _
& "tblPropertyType = '" & tblPropertyType & "', " _
& "tblRooms ='" & tblRooms & "', " _
& "tblWeeklyPrice = '" & tblWeeklyPrice & "', " _
& "tblImage = '" & tblImage & "', " _
& "tblBriefDescription = '" & tblBriefDescription & "', " _
& "tblDetailedDescription = '" & tblDetailedDescription & "', " _
& "tblStatus = '" & tblStatus & "', " _
& "tblAddress1 = '" & tblAddress1 & "', " _
& "tblAddress2 = '" & tblAddress2 & "', " _
& "tblAddress3 = '" & tblAddress3 & "', " _
& "tblAddress4 = '" & tblAddress4 & "', " _
& "tblPostCode = '" & tblPostCode & "', " _
& "tblCountry = '" & tblCountry & "', " _
& "idArea = '" & idArea & "', " _
& "Deleted = '" & Deleted & "' WHERE " _
& "idProperty = " & ID

Response.Write(strSQL)
Response.End
%>

b) Then check here for explanations of the cause:
http://www.adopenstatic.com/faq/80040e14.asp

Cheers
Ken

[quoted text, click to view]
: The following is the code, can someone please help me with the syntax
please
: in the first line please
:
: Conn.Execute "UPDATE tblRentalProperty SET " _
: & "tblPropertyType = '" & tblPropertyType & "', " _
: & "tblRooms ='" & tblRooms & "', " _
: & "tblWeeklyPrice = '" & tblWeeklyPrice & "', " _
: & "tblImage = '" & tblImage & "', " _
: & "tblBriefDescription = '" & tblBriefDescription & "', " _
: & "tblDetailedDescription = '" & tblDetailedDescription & "', " _
: & "tblStatus = '" & tblStatus & "', " _
: & "tblAddress1 = '" & tblAddress1 & "', " _
: & "tblAddress2 = '" & tblAddress2 & "', " _
: & "tblAddress3 = '" & tblAddress3 & "', " _
: & "tblAddress4 = '" & tblAddress4 & "', " _
: & "tblPostCode = '" & tblPostCode & "', " _
: & "tblCountry = '" & tblCountry & "', " _
: & "idArea = '" & idArea & "', " _
: & "Deleted = '" & Deleted & "' WHERE " _
: & "idProperty = " & ID

David Wapnick
9/29/2003 8:05:38 AM
I have to say that your response was great and I have solved the problem,
many thanks to you.

Regards,

David

[quoted text, click to view]

Ken Schaefer
9/29/2003 8:23:16 PM
Glad you got the problem solved!

Cheers
Ken


[quoted text, click to view]
: I have to say that your response was great and I have solved the problem,
: many thanks to you.
:
: Regards,
:
: David
:
[quoted text, click to view]
: > a) First, allocate the string to a variable, and response.write() the
: value,
: > so you can see what's being sent to the database.
: >
: > eg:
: >
: > <%
: > strSQL = "UPDATE tblRentalProperty SET " _
: > & "tblPropertyType = '" & tblPropertyType & "', " _
: > & "tblRooms ='" & tblRooms & "', " _
: > & "tblWeeklyPrice = '" & tblWeeklyPrice & "', " _
: > & "tblImage = '" & tblImage & "', " _
: > & "tblBriefDescription = '" & tblBriefDescription & "', " _
: > & "tblDetailedDescription = '" & tblDetailedDescription & "', " _
: > & "tblStatus = '" & tblStatus & "', " _
: > & "tblAddress1 = '" & tblAddress1 & "', " _
: > & "tblAddress2 = '" & tblAddress2 & "', " _
: > & "tblAddress3 = '" & tblAddress3 & "', " _
: > & "tblAddress4 = '" & tblAddress4 & "', " _
: > & "tblPostCode = '" & tblPostCode & "', " _
: > & "tblCountry = '" & tblCountry & "', " _
: > & "idArea = '" & idArea & "', " _
: > & "Deleted = '" & Deleted & "' WHERE " _
: > & "idProperty = " & ID
: >
: > Response.Write(strSQL)
: > Response.End
: > %>
: >
: > b) Then check here for explanations of the cause:
: > http://www.adopenstatic.com/faq/80040e14.asp
: >
: > Cheers
: > Ken
: >
[quoted text, click to view]
: > : The following is the code, can someone please help me with the syntax
: > please
: > : in the first line please
: > :
: > : Conn.Execute "UPDATE tblRentalProperty SET " _
: > : & "tblPropertyType = '" & tblPropertyType & "', " _
: > : & "tblRooms ='" & tblRooms & "', " _
: > : & "tblWeeklyPrice = '" & tblWeeklyPrice & "', " _
: > : & "tblImage = '" & tblImage & "', " _
: > : & "tblBriefDescription = '" & tblBriefDescription & "', " _
: > : & "tblDetailedDescription = '" & tblDetailedDescription & "', " _
: > : & "tblStatus = '" & tblStatus & "', " _
: > : & "tblAddress1 = '" & tblAddress1 & "', " _
: > : & "tblAddress2 = '" & tblAddress2 & "', " _
: > : & "tblAddress3 = '" & tblAddress3 & "', " _
: > : & "tblAddress4 = '" & tblAddress4 & "', " _
: > : & "tblPostCode = '" & tblPostCode & "', " _
: > : & "tblCountry = '" & tblCountry & "', " _
: > : & "idArea = '" & idArea & "', " _
: > : & "Deleted = '" & Deleted & "' WHERE " _
: > : & "idProperty = " & ID
: >
: >
:
:

AddThis Social Bookmark Button