Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/03/2002, 18:59
rashid
 
Fecha de Ingreso: enero-2002
Ubicación: Perez Zeledon Costa Rica
Mensajes: 1.009
Antigüedad: 23 años, 1 mes
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:


<!-- #include file="adovbs.inc" -->
<!-- #include file="auctionlib.asp" -->
<%
iPrice = FVal(request.querystring("price"))
sLong = request.querystring("long")

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

Call DoPageHeader

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

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

If objPagingRS.eof then
Response.Write("NO CURRENT AUCTIONS IN THIS CATEGORY")
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 = "#E9E9E9"
iswitch = False
Else scolor = "#FFFFFF"
iswitch = TRUE
End If

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

Set BidCountRS = Nothing
objPagingRS.MoveNext
Loop
objPagingRS.close
Set objPagingRS = Nothing
End if
%>

Ayudaaa.. :(