Go Back   Cyber Tech Help Support Forums > Software > Web Development & Graphic Design

Notices

Web Development & Graphic Design Problem Solving for Graphic Design, PHP, ASP, Perl, MySQL, SQL, XML, HTML issues

Reply
 
Topic Tools
  #1  
Old January 27th, 2005, 05:20 PM
Opacus Opacus is offline
New Member
 
Join Date: Jan 2005
Posts: 1
Getting Odd SQL Error message

Ok, so I have no idea why a certain web page is giving up this error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'LIKE'.

/iframe-searchwarranty.asp, line 157



When I look at the ASP code it looks like this:


<% 'on error resume next
sql= "select warrantynumber, custname, custCity, custState, date_warranty_request_doc, Date_installation_doc, date_rgn_doc from warranty_doc where"
'use j variable to select if put an "AND"
'use k variable to select if the statement will show or not
j=0
k=0
For each item in request.form

if (len(Trim(Request.Form(item)))>0 and item<>"Submit22") then
fieldname=item
fieldnameValue=replace(Request.Form(item),"'","''" )
if j=1 then
sql = sql &" AND "
end if
sql=sql & fieldname &" LIKE '"&trim(fieldnamevalue)&"%' "
j=1
k=1
end if
Next
sql = sql & " order by warrantynumber DESC, custName ASC"
%>


When I parse the SQL in QueryAnalyzer it is all happy and fun. PLEASE tell me what I am doing wrong... I have been trying to work this out for hours now and there is very little in the way of help on that particular error...

I am ever so grateful for you even reading my post, have a great day.
Reply With Quote
  #2  
Old January 30th, 2005, 08:25 PM
Steven.Bentley Steven.Bentley is offline
CTH Subscriber
 
Join Date: Nov 2000
Location: West Yorkshire, UK
Age: 45
Posts: 3,840
I'd echo (or the ASP equivalent) out the sql variable, see what the full query is and see whether that looks right
Reply With Quote
Reply

Bookmarks

Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Topic Topic Starter Forum Replies Last Post
Error Message related to: Norton Internet Security 2007 Error Message Says: kota116 The Anything Else Board 0 June 18th, 2007 10:15 PM
Error message- Run-time error '48': File not found: Psapi.dll Xeno-Fenix Windows ME 4 January 30th, 2005 08:21 AM
Error Message: MSScript Control: (Unknown Error) mebel Windows ME 20 September 14th, 2004 05:19 AM
Error message: Explorer has caused an error in <unknown> OSUBuckeye Windows ME 2 September 3rd, 2004 06:40 AM
Error Message: Error Loading Explorer.exe You Must Reinstall Windows Suedehead Windows 98 10 September 21st, 2003 02:37 AM


All times are GMT +1. The time now is 10:58 PM.