Foros del Web » Programación para mayores de 30 ;) » .NET »

¿Hay algo mal en este SQL?

Estas en el tema de ¿Hay algo mal en este SQL? en el foro de .NET en Foros del Web. No me funciona y no veo el error: gsSQL = "" gsSQL = gsSQL & "SELECT * FROM Auctions WHERE StartingBid < 1000 And Size ...
  #1 (permalink)  
Antiguo 27/03/2002, 17:48
 
Fecha de Ingreso: enero-2002
Ubicación: Perez Zeledon Costa Rica
Mensajes: 1.009
Antigüedad: 22 años, 3 meses
Puntos: 11
¿Hay algo mal en este SQL?

No me funciona y no veo el error:
gsSQL = ""
gsSQL = gsSQL & "SELECT * FROM Auctions WHERE StartingBid < 1000 And Size < 1000000 "
objPagingRS.Open gsSQL, GobjConnect, adOpenStatic, adLockReadOnly, adCmdText


Me da error en la linea 23 y en esta linea esta
objPagingRS.Open gsSQL, GobjConnect, adOpenStatic, adLockReadOnly, adCmdText

La tabla tiene items con StartingBid menor a 1000 y tiene items con size menor a 1000000.
¿Qué pasa? ;) :(

  #2 (permalink)  
Antiguo 27/03/2002, 18:34
Avatar de ashketchum  
Fecha de Ingreso: julio-2001
Ubicación: En algun lugar de un gran pais
Mensajes: 418
Antigüedad: 22 años, 9 meses
Puntos: 0
Re: ¿Hay algo mal en este SQL?

Ya probaste poniendo algo como esto:

WHERE (StartingBid < 1000) And (Size < 1000000)

saludos y suerte


@sh (Maestro Pokémon trajo esto para tí) :-p <br> Fomentando el concepto "INTERNET"
  #3 (permalink)  
Antiguo 27/03/2002, 18:59
 
Fecha de Ingreso: enero-2002
Ubicación: Perez Zeledon Costa Rica
Mensajes: 1.009
Antigüedad: 22 años, 3 meses
Puntos: 11
Re: ¿Hay algo mal en este SQL?

Gracias, le hice unos cambios y ahora corre, pero en la formula escribo 10000 y la sentencia debe mandarme todos los registros cuyo bid sea menor a 10000, pero en lugar de eso me manda los unico dos con bid = 0, y la reviso y no entiendo que hace que me responda los que tienen bid =0.
Alguien tiene idea?
Este es el codigo entero:


&lt;!-- #include file=&quot;adovbs.inc&quot; --&gt;
&lt;!-- #include file=&quot;auctionlib.asp&quot; --&gt;
&lt;%
iPrice = FVal(request.querystring(&quot;price&quot;))
sLong = request.querystring(&quot;long&quot;)

iPageSize = 10
If Request.QueryString(&quot;page&quot;) = &quot;&quot; Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString(&quot;page&quot;))
End If

Call DoPageHeader

Set GobjConnect = server.createobject(&quot;ADODB.Connection&quot;)
GobjConnect.open gsConnect
' Create recordset
Set objPagingRS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
' Set cursor location and pagesize
objPagingRS.CursorLocation = adUseClient
objPagingRS.PageSize = iPageSize

gsSQL = &quot;&quot;
gsSQL = gsSQL &amp; &quot;SELECT * FROM Auctions WHERE StartingBid &lt;= &quot; &amp; SQLVal(iPrice) &amp; &quot; &quot;
'Response.Write gsSQL
objPagingRS.Open gsSQL, GobjConnect, adOpenStatic, adLockReadOnly, adCmdText

If objPagingRS.eof then
Response.Write(&quot;NO CURRENT AUCTIONS IN THIS CATEGORY&quot;)
Else
' Move to the selected page
objPagingRS.AbsolutePage = iPageCurrent
iswitch = TRUE
Do While objPagingRS.AbsolutePage = iPageCurrent And Not objPagingRS.EOF
If iswitch = TRUE then
scolor = &quot;#E9E9E9&quot;
iswitch = False
Else scolor = &quot;#FFFFFF&quot;
iswitch = TRUE
End If

Response.Write(objPagingRS.Fields(&quot;ItemTitle& quot;))

Set BidCountRS = Nothing
objPagingRS.MoveNext
Loop
objPagingRS.close
Set objPagingRS = Nothing
End if
%&gt;

Ayudaaa.. :(
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 16:35.