Foros del Web » Programando para Internet » ASP Clásico »

Ayuudaaaaaaaa

Estas en el tema de Ayuudaaaaaaaa en el foro de ASP Clásico en Foros del Web. SQL="SELECT * FROM Grabaciones WHERE Interprete=left(Interprete,1)="' & Letra & '"" Me dice lo siguiente: [Microsoft][Controlador ODBC Microsoft Access] Error de sintaxis (falta operador) en la ...
  #1 (permalink)  
Antiguo 10/05/2002, 06:28
 
Fecha de Ingreso: marzo-2002
Mensajes: 21
Antigüedad: 23 años, 2 meses
Puntos: 0
Ayuudaaaaaaaa

SQL="SELECT * FROM Grabaciones WHERE Interprete=left(Interprete,1)="' & Letra & '""

Me dice lo siguiente:

[Microsoft][Controlador ODBC Microsoft Access] Error de sintaxis (falta operador) en la expresión de consulta 'Interprete=left(Interprete,1)='.

Alguien ve el fallo?
  #2 (permalink)  
Antiguo 10/05/2002, 06:37
 
Fecha de Ingreso: abril-2002
Mensajes: 161
Antigüedad: 23 años
Puntos: 0
Re: Ayuudaaaaaaaa

Perdona miruba, pero que es "left", una función? y le pasas dos parámetros? lo siento, pero es que no lo entiendo :(
¿Te importaría dejar espacios entre las comillas?, es para distinguirlas mejor...
  #3 (permalink)  
Antiguo 10/05/2002, 06:42
 
Fecha de Ingreso: marzo-2002
Mensajes: 21
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Ayuudaaaaaaaa

Con el left(interprete,1) lo que intento hacer es que me compare la variable letra con la primera letra de cada registro del campo interprete. Es una función.
Aquí va con espacios:

SQL="SELECT * FROM Grabaciones WHERE Interprete = left(Interprete,1)= " ' & Letra & ' " "
  #4 (permalink)  
Antiguo 10/05/2002, 09:22
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: Ayuudaaaaaaaa

SQL="SELECT * FROM Grabaciones WHERE Interprete = left(Interprete,1)= '" & Letra & "' "


saludos


<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #5 (permalink)  
Antiguo 10/05/2002, 20:23
 
Fecha de Ingreso: marzo-2002
Mensajes: 21
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Ayuudaaaaaaaa

Urjose, Hago lo que tu me dices y ya no me da error, pero tampoco me saca ningún resultado, aunque en la tabla hay registros que debería sacar.
  #6 (permalink)  
Antiguo 10/05/2002, 21:00
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: Ayuudaaaaaaaa

SQL=&quot;SELECT * FROM Grabaciones WHERE Interprete LIKE '&quot;&amp;Letra&amp;&quot;%'&quot;

Prubea y nos cuentas.

Saludos

<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #7 (permalink)  
Antiguo 10/05/2002, 21:18
 
Fecha de Ingreso: marzo-2002
Mensajes: 21
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Ayuudaaaaaaaa

Pues nada, que seguimos igual. Alguna otra idea, please?
  #8 (permalink)  
Antiguo 10/05/2002, 21:20
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: Ayuudaaaaaaaa

Que extraño, por que dices que no regresa ningun resultado?

De que formas recorres los registros?

Saludos

<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #9 (permalink)  
Antiguo 10/05/2002, 21:27
 
Fecha de Ingreso: marzo-2002
Mensajes: 21
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Ayuudaaaaaaaa


Ahí va eso. Echale un vistazo por favor:
&lt;%

Letra=Request.QueryString (&quot;Letra&quot;)
Set Base = Server.CreateObject (&quot;ADODB.Connection&quot;)
Base.Open &quot;DRIVER={Microsoft Access Driver (*.mdb)};DBQ=&quot; &amp; Server.MapPath(&quot;\database\Mp3.mdb&quot;)
SET Obj_RS = Server.CreateObject (&quot;ADODB.Recordset&quot;)

SQL=&quot;SELECT * FROM Grabaciones WHERE Interprete LIKE '&quot;&amp;Letra&amp;&quot;%'&quot;

Obj_RS.Open SQL, Base, 3, 3

IF Obj_RS.RecordCount &lt;&gt; 0 THEN
DO WHILE NOT Obj_RS.Eof

%&gt;
&lt;table class=&quot;tabla&quot; align=center&gt;
&lt;TR&gt;
&lt;TD width=250 align=center valign=top&gt;
&lt;img src=&quot;&lt;%=Obj_RS (&quot;portada&quot;) %&gt;&quot;WIDTH=125 HEIGTH=125&gt;&lt;BR&gt;
&lt;a href=&quot;clicks.asp?url=Descarga.asp?Cod_Titulo= &lt;%=Obj_RS (&quot;Cod_Titulo&quot;)%&gt;&quot;&gt;&lt;B&gt;&l t;%=Obj_RS(&quot;Interprete&quot;)%&gt;&lt;BR&gt;
&lt;%=Obj_RS(&quot;Titulo&quot;)%&gt;&lt;BR&gt;
&lt;/TD&gt;
&lt;%
Obj_RS.MoveNext
%&gt;
&lt;TD width=250 align=center valign=top&gt;
&lt;img src=&quot;&lt;%=Obj_RS (&quot;portada&quot;) %&gt;&quot;WIDTH=125 HEIGTH=125&gt;&lt;BR&gt;
&lt;a href=&quot;Descarga.asp?Cod_Titulo=&lt;%=Obj_RS (&quot;Cod_Titulo&quot;)%&gt;&quot;&gt;&lt;B&gt;&l t;%=Obj_RS(&quot;Interprete&quot;)%&gt;&lt;BR&gt;
&lt;%=Obj_RS(&quot;Titulo&quot;)%&gt;&lt;BR&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;%
Obj_RS.MoveNext
LOOP
%&gt;

&lt;/TABLE&gt;
&lt;%
ELSE
%&gt;
No hay registros con la letra &lt;%=&quot; &amp; letra &amp; &quot;%&gt;
&lt;%
END IF

Obj_RS.Close
Base.close
SET Obj_RS=Nothing
SET Base=Nothing
%&gt;
&lt;/td&gt;
  #10 (permalink)  
Antiguo 10/05/2002, 21:34
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: Ayuudaaaaaaaa

Intenta cambiando esta línea:

IF Obj_RS.RecordCount &lt;&gt; 0 THEN

por esta

IF NOT Obj_RS.EOF AND NOT Obj_RS.BOF THEN

Prueba y nos cuentas.

Saludos

<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
  #11 (permalink)  
Antiguo 10/05/2002, 21:38
 
Fecha de Ingreso: marzo-2002
Mensajes: 21
Antigüedad: 23 años, 2 meses
Puntos: 0
Re: Ayuudaaaaaaaa

BINGO :cantar: . Ahí si has dado en el clavo. Muchas gracias.
  #12 (permalink)  
Antiguo 10/05/2002, 21:41
Avatar de urjose  
Fecha de Ingreso: diciembre-2001
Mensajes: 5.286
Antigüedad: 23 años, 4 meses
Puntos: 1
Re: Ayuudaaaaaaaa

Le atine ;)

<center><img src="http://www.pcmasmas.com.ar/foro/images/avatars/043.gif"><br>
Urjose</center>
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:24.