I keep getting this error can anyone help me find the error. I have been searching for two days. Any help is greatly appreciated.
Here is what I have. I have a table residing on a server which has all read, write, change access. It is named "tbl_Service_Providers"
I'm reading three fields in the table "Approved", "Services_Provided" (Could contain multiple Values in it seperated by comma's in it (MEMO FIELD)), "AreaCovered" (Could contain multiple values seperated by comma's in it (MEMO FIELD)). Based on the selections on the asp page it should pull all matching records. I'm using the "%" as my wildcard for multiple value fields.
<!----- Error ----->
Microsoft JET Database Engineerror '80040e14'
Syntax error (comma) in query expression 'Approved, Services_Provided, CoverageArea LIKE 'True' 'Air Conditioning & Cooling' '27611''. /servicebidpro/DOUG EmployeeReports (Design).asp, line 851
<!----- END ERROR ----->
Snippet of area with actual error "ACTUAL WRITTEN CODE"
** I didnt want to provide complete code to save server space in forum as its over 1000 lines long but if you need I can...
Code:
if DetectedButton = "Get Provider Based on Approval, Service, Coverage" then
'Prep the database to be accessed
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open(Server.Mappath("/Mypath to db.mdb"))
set rs = Server.CreateObject("ADODB.recordset")
'Format the Query to use against the database
sql="SELECT Service_Company_Name, Contact_Name FROM tbl_Service_Providers WHERE "
sql = sql & "Approved, " & "Services_Provided, " & "CoverageArea " & "LIKE "
sql = sql & "'" & Request.Form("ApprovedorNot") & "' "
sql = sql & "'" & Request.Form("ServiceType") & "' "
sql = sql & "'" & Request.Form("CoverageArea") & "'"
Response.Write(sql)
rs.Open sql, conn
Here is the code that is sent after you make your selections and hit the appropriate button to get records.
Code:
SELECT Service_Company_Name, Contact_Name FROM tbl_Service_Providers WHERE Approved, Services_Provided, CoverageArea LIKE 'True' 'Air Conditioning & Cooling' '27611'