Tema: recordset!!
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/08/2002, 12:05
yoyi2002
 
Fecha de Ingreso: julio-2002
Ubicación: Santiago
Mensajes: 172
Antigüedad: 22 años, 10 meses
Puntos: 0
recordset!!

TENGO EL SGTE PROBLEMA: CUANDO MI TABLA NO TIENE DATOS EL CODIGO SIGUIENTE NO
ME FUNCIONA SE SUPONE QUE NUMERO DEBERIA TOMAR EL VALOR 1, Y MOSTRARLO EN EL TEXT
NUMERO_ASESORIA, PERO NO LO HACE. SI TENGO DATOS FUNCIONA, ESTE ES EL CODIGO

<%set conexion = conecta()
set rs_maximo=Server.CreateObject("ADODB.Recordse t")
sql= "select max(numero_asesoria) as maximo from asesora"
rs_maximo.open sql, conexion


if not rs_maximo.eof then
numero=rs_maximo("maximo")
numero= numero + 1
else
numero=1
end if


%>

<input type="text" name="numero_asesoria" size="15" maxlength="5" value="<%response.write numero%>">


ESTE ES EL CODIGO QUE TIENE PROBLEMAS
If not rs_maximo.eof then
numero=rs_maximo("maximo")
numero= numero + 1
else
numero=1(ESTO NO LO HACE)
end if
QUE ME ENTREGA EL RECORSET CUANDO UNA TABLA ESTA VACIA, PROBE CON -1, NULL.... Y NO ME FUNCIONO??