QuoteReplyTopic: NEED SQL HELP..Expected End of Statement Posted: 22 September 2003 at 5:36am
I need some serious help here. I am working on a time schedule, writing a script for my unit, ove here in the desert (IRAQ). I am getting the following error, in my asp page. I am writting a page to search a database, and provide the records on a results page. Heres the error..
Error Type: Microsoft VBScript compilation (0x800A0401) Expected end of statement /blue2results.asp, line 51, column 28 rsResults.Source = "SELECT "DIVENG FRAGO", "Group Frago", "MSN_Number", "Work Unit", "Complete", "Priority Mission" FROM "BLUE 2 PROJECTS" WHERE "DIVENG FRAGO" LIKE '" + Replace(rsResults__vardivfrago, "'", "''") + "' OR "Group Frago" LIKE '" + Replace(rsResults__vargroupfrago, "'", "''") + "' OR "MSN Number" LIKE '" + Replace(rsResults__varmsnnumber, "'", "''") + "' OR "Work Unit" LIKE '" + Replace(rsResults__varworkunit, "'", "''") + "' OR "Complete" LIKE '" + Replace(rsResults__varcomplete, "'", "''") + "' OR "Priority Mission" LIKE '" + Replace(rsResults__varprioritymission, "'", "''") + "'"; ---------------------------^
Not necessary, it means the processor expected the statement to end and it didn't.
The problem here is the quotes. Change your select list to * and work out the problems. In the future, I would suggest not using Column name with spaces.
I need some serious help here. I am working on a time schedule, writing a script for my unit, ove here in the desert (IRAQ). I am getting the following error, in my asp page. I am writting a page to search a database, and provide the records on a results page. Heres the error..
Error Type: Microsoft VBScript compilation (0x800A0401) Expected end of statement /blue2results.asp, line 51, column 28 rsResults.Source = "SELECT "DIVENG FRAGO", "Group Frago", "MSN_Number", "Work Unit", "Complete", "Priority Mission" FROM "BLUE 2 PROJECTS" WHERE "DIVENG FRAGO" LIKE '" + Replace(rsResults__vardivfrago, "'", "''") + "' OR "Group Frago" LIKE '" + Replace(rsResults__vargroupfrago, "'", "''") + "' OR "MSN Number" LIKE '" + Replace(rsResults__varmsnnumber, "'", "''") + "' OR "Work Unit" LIKE '" + Replace(rsResults__varworkunit, "'", "''") + "' OR "Complete" LIKE '" + Replace(rsResults__varcomplete, "'", "''") + "' OR "Priority Mission" LIKE '" + Replace(rsResults__varprioritymission, "'", "''") + "'"; ---------------------------^
Change it to:
rsResults.Source = "SELECT ""DIVENG FRAGO"", ""Group Frago"", ""MSN_Number"", ""Work Unit"", ""Complete"", ""Priority Mission"" FROM ""BLUE 2 PROJECTS"" WHERE ""DIVENG FRAGO"" LIKE '""" + Replace(rsResults__vardivfrago, "'", "''") + """' OR ""Group Frago"" LIKE '" + Replace(rsResults__vargroupfrago, "'", "''") + "' OR ""MSN Number"" LIKE '" + Replace(rsResults__varmsnnumber, "'", "''") + "' OR ""Work Unit"" LIKE '" + Replace(rsResults__varworkunit, "'", "''") + "' OR ""Complete"" LIKE '" + Replace(rsResults__varcomplete, "'", "''") + "' OR ""Priority Mission"" LIKE '" + Replace(rsResults__varprioritymission, "'", "''") + "'"
Then buy a text editor with decent syntax highlighting.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum
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.