Microsoft JET Database Engine (0x80040E14) -2
får nu denne fejl:Microsoft JET Database Engine (0x80040E14)
Der er en syntaksfejl, fordi der mangler en operator. i forespørgselsudtrykket "and (uCase(productName) like '%VENTEGODT%' or uCase(productDesc) like '%VENTEGODT%')".
I denne kode:
<%
chkText = Request.form("chkText")
strText = cstr(Request.form("strText"))
strText = uCase(strText)
chkCat = Request.form("chkCat")
strCat = Request.form("strCat")
strTextWhere = ""
strCatWhere = ""
if chkText = "yes" then
strTextWhere = " and (uCase(productName) like '%"&strText&"%'"
strTextWhere = strTextWhere & " or uCase(productDesc) like '%"_
& strText & "%')"
end if
if chkCat = "yes" then
strCatWhere = " boger.catalogID = " & strCat
end if
set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConString
sqlText = "select distinct boger.productID, "
sqlText = sqlText & "boger.productName "
sqlText = sqlText & "from boger "
sqlText = sqlText & "where "
if len(strTextWhere) > 0 then
sqlText = sqlText & strTextWhere
end if
if len(strCatWhere) > 0 then
if len(strTextWhere) > 0 then
sqlText = sqlText & " and "
end if
sqlText = sqlText & strCatWhere
end if
%>
<%
'response.write(sqlText)
'response.end
set rsProd = Conn.Execute(sqlText)
If rsProd.BOF And rsProd.EOF Then
Response.Write "<font face='Verdana' size='2'><strong>"
Response.Write "No items found, please narrow your <a href='search.asp'>search.</a></b>"
end if
while not rsProd.EOF
%>
<a href="product.asp?intProdID=<% Response.Write rsProd("productID") %>">
<%= rsProd("productName") %> </a><br>
<%
rsProd.MoveNext
wend
rsProd.Close
set rsProd = Nothing
Conn.Close
set Conn = Nothing
%>
