Error :
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'es = 'Insumos' and marca = 'HP' and (copete LIKE '%m656%' modelo LIKE '%m656%' ) OR (detalle LIKE '%m656%' )'.
/toners-alternativos.asp, line 280
Archivo :
Cita:
if i > 0 then
sql = sql & " and "
end if
sql = sql & "copete LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>SQLant : " & sql &"<br>"
pbuscar = Request.form("cartucho")
arr = split(pbuscar," ")
sql = sql & ") OR ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "detalle LIKE '%" & arr(i) & "%' "
next
'response.write "<br>ISEG: " & i & "<br>"
'response.write sql & ")"
Recordset1.Source = sql & ")" ' aca termina el sql XXXXXXXXXXXXXXXXXXXXXXXX
elseif Request.form("marca") <> "" and Request.form("cartucho") <> "" and Request.form("impresora") <> "" then
'response.write "c"
pbuscar = Request.form("impresora") & " " & Request.form("cartucho")
arr = split(pbuscar," ")
sql = "SELECT * FROM completo WHERE es = '" & defecto & "' and marca = '" & request.form("marca") & "' and ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "copete LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>SQLant : " & sql &"<br>"
pbuscar = Request.form("impresora") & " " & Request.form("cartucho")
arr = split(pbuscar," ")
sql = sql & ") or ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "detalle LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>ISEG: " & i & "<br>"
'response.write sql & ")"
Recordset1.Source = sql & ")" ' aca termina el sql XXXXXXXXXXXXXXXXXXXXXXXX
elseif Request.form("marca") <> "" and Request.form("cartucho") = "" and Request.form("impresora") <> "" then
'response.write "d"
pbuscar = Request.form("impresora")
arr = split(pbuscar," ")
sql = "SELECT * FROM completo WHERE es = '" & defecto & "' and marca = '" & request.form("marca") & "' and ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "copete LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>SQLant : " & sql &"<br>"
pbuscar = Request.form("impresora")
arr = split(pbuscar," ")
sql = sql & ") OR ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "detalle LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>ISEG: " & i & "<br>"
'response.write sql & ")"
Recordset1.Source = sql & ")" ' aca termina el sql XXXXXXXXXXXXXXXXXXXXXXXX
Else
Recordset1.Source = "SELECT * FROM completo WHERE es = '" & defecto & "' ORDER by titulo DESC"
end if
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
--------------> LINEA 280 ### Recordset1.Open() <-------------- LINEA 280 #####
sql = sql & " and "
end if
sql = sql & "copete LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>SQLant : " & sql &"<br>"
pbuscar = Request.form("cartucho")
arr = split(pbuscar," ")
sql = sql & ") OR ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "detalle LIKE '%" & arr(i) & "%' "
next
'response.write "<br>ISEG: " & i & "<br>"
'response.write sql & ")"
Recordset1.Source = sql & ")" ' aca termina el sql XXXXXXXXXXXXXXXXXXXXXXXX
elseif Request.form("marca") <> "" and Request.form("cartucho") <> "" and Request.form("impresora") <> "" then
'response.write "c"
pbuscar = Request.form("impresora") & " " & Request.form("cartucho")
arr = split(pbuscar," ")
sql = "SELECT * FROM completo WHERE es = '" & defecto & "' and marca = '" & request.form("marca") & "' and ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "copete LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>SQLant : " & sql &"<br>"
pbuscar = Request.form("impresora") & " " & Request.form("cartucho")
arr = split(pbuscar," ")
sql = sql & ") or ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "detalle LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>ISEG: " & i & "<br>"
'response.write sql & ")"
Recordset1.Source = sql & ")" ' aca termina el sql XXXXXXXXXXXXXXXXXXXXXXXX
elseif Request.form("marca") <> "" and Request.form("cartucho") = "" and Request.form("impresora") <> "" then
'response.write "d"
pbuscar = Request.form("impresora")
arr = split(pbuscar," ")
sql = "SELECT * FROM completo WHERE es = '" & defecto & "' and marca = '" & request.form("marca") & "' and ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "copete LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>SQLant : " & sql &"<br>"
pbuscar = Request.form("impresora")
arr = split(pbuscar," ")
sql = sql & ") OR ("
for i = 0 to ubound(arr)
if i > 0 then
sql = sql & " and "
end if
sql = sql & "detalle LIKE '%" & arr(i) & "%' "
sql = sql & "modelo LIKE '%" & arr(i) & "%' "
next
'response.write "<br>ISEG: " & i & "<br>"
'response.write sql & ")"
Recordset1.Source = sql & ")" ' aca termina el sql XXXXXXXXXXXXXXXXXXXXXXXX
Else
Recordset1.Source = "SELECT * FROM completo WHERE es = '" & defecto & "' ORDER by titulo DESC"
end if
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
--------------> LINEA 280 ### Recordset1.Open() <-------------- LINEA 280 #####