Ver Mensaje Individual
  #2 (permalink)  
Antiguo 23/06/2004, 08:18
debspain
 
Fecha de Ingreso: noviembre-2002
Mensajes: 224
Antigüedad: 22 años, 5 meses
Puntos: 1
hola fredo!

Sería algo parecido a esto:

miDni = request.form("dni")
otroCampo = request.form("otroCampo")

set Conexion = Server.createObject("ADODB.Conection")
set Rs = Server.createObject("ADODB.Recordset")
set Rs1 = Server.createObject("ADODB.Recordset")

sql = "Select * from Tabla where dni='" & miDni & "'"
Rs.open SQL,Conexion,adOpenStatic,adlockReadOnly,adCmdText
if Rs.EOF and Rs.BOF then

'No hay nadie registrado con ese dni
Rs1.open "Tabla",Conexion,adOpenKeySet,adlockOptimistic,adC mdTable
Rs1.AddNew
Rs1("dni") = miDni
Rs1("otroCampo") = otroCampo
Rs1.Update
Rs1.close
Rs.close
Conexion.close
set Rs1= nothing
set Rs = nothing
set Conexion = nothing
Response.redirect "Agradecimiento.html"
else

'EL dni está repetido
Rs.close
Conexion.close
set Rs = nothing
set Conexion = nothing
Response.redirect "Aviso.html"
end if
He supuesto que si no existe, lo registrarás. Si solo te interesa redirigirlo, quita cualquier linea que contenga un Rs1.
Espero que funcione. xao!