Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/07/2002, 16:25
Owen-Bonilla
 
Fecha de Ingreso: mayo-2001
Ubicación: Monterrey, N.L.; México
Mensajes: 558
Antigüedad: 24 años
Puntos: 0
Error en buscador

Este codigo esta un poco largo, pero para que me entiendan pondre solo lo necesario.

Estas lineas me realizan la conexión a la DB

Código:
Dim con
	Set con = CreateObject("ADODB.Connection")
	con.Open strDB


cat=Split(Replace(request.querystring("FormCat"),"'","''")) 
myquery="SELECT * FROM tblEvents WHERE (((tblEvents.End_Date)>Date())) & INSTR(Event_Description,'"&cat(0)&"') & INSTR(Event_Name,'"&cat(0)&"') & INSTR(Event_Venue,'"&cat(0)&"') & INSTR(Contact_Name,'"&cat(0)&"') & INSTR(Even_Url,'"&cat(0)&"') & INSTR(More_Info,'"&cat(0)&"') & INSTR(Town,'"&cat(0)&"')" & _
Request.QueryString("formcat") & "%' ORDER BY Start_Date ASC  "

For i=1 to Ubound(cat)

myquery=myquery&" (((tblEvents.End_Date)>Date())) & OR INSTR(Event_name,'"&Busqueda(I)&"') OR INSTR(Event_venu,'"&Busqueda(I)&"') OR INSTR(contact_name,'"&Busqueda(I)&"') OR INSTR(event_url,'"&Busqueda(I)&"') OR INSTR(more_info,'"&Busqueda(I)&"') OR INSTR(town,'"&Busqueda(I)&"')"

Next 

Dim rs
	Set rs = CreateObject("ADODB.Recordset")
	rs.CursorLocation = adUseClient
	rs.PageSize = recordsToShow
	rs.CacheSize = recordsToShow
	rs.Open myquery, con, 3, 3

Ahora, me manda este error:

Código:
Tipo de error:
Microsoft JET Database Engine (0x80040E14)
Error de sintaxis (falta operador) en la expresión de consulta '(((tblEvents.End_Date)>Date())) & INSTR(Event_Description,'owen') & INSTR(Event_Name,'owen') & INSTR(Event_Venue,'owen') & INSTR(Contact_Name,'owen') & INSTR(Even_Url,'owen') & INSTR(More_Info,'owen') & INSTR(Town,'owen')owen%' ORDER BY Start_Date ASC'.
/rediseño/directorio/category_results.asp, línea 65
La linea 65 es esta: rs.Open myquery, con, 3, 3

Arriba en el código marque en NEGRITA la linea "hasta donde llega a recorrer el código" ....

Qué puede estar mal?

Saludos y Gracias

Owen Bonilla
Webmaster Weblaguna S. C.
[email protected]
[email protected]