Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / Database Access / September 2003



Tip: Looking for answers? Try searching our database.

Syntax error (missing operator) in query expression'idProperty='

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Wapnick - 28 Sep 2003 09:46 GMT
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 - 28 Sep 2003 09:52 GMT
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

: The following is the code, can someone please help me with the syntax please
: in the first line please
[quoted text clipped - 16 lines]
: & "Deleted = '" & Deleted & "' WHERE  " _
: & "idProperty = " & ID
David Wapnick - 29 Sep 2003 09:05 GMT
I have to say that your response was great and I have solved the problem,
many thanks to you.

Regards,

David

> a) First, allocate the string to a variable, and response.write() the value,
> so you can see what's being sent to the database.
[quoted text clipped - 51 lines]
> : & "Deleted = '" & Deleted & "' WHERE  " _
> : & "idProperty = " & ID
Ken Schaefer - 29 Sep 2003 11:23 GMT
Glad you got the problem solved!

Cheers
Ken

: I have to say that your response was great and I have solved the problem,
: many thanks to you.
[quoted text clipped - 59 lines]
: > : & "Deleted = '" & Deleted & "' WHERE  " _
: > : & "idProperty = " & ID
Atrax - 28 Sep 2003 10:12 GMT
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/
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.