Ver Mensaje Individual
  #11 (permalink)  
Antiguo 23/06/2004, 11:43
Avatar de fredo
fredo
 
Fecha de Ingreso: marzo-2004
Mensajes: 47
Antigüedad: 21 años, 1 mes
Puntos: 0
debspain, te paso como me quedaron las páginas adaptadas al código que vos me pasaste:

---------------------------
index.htm
---------------------------
<html>

<head>
<title>Index</title>
</head>

<body>
<center>

<b>Registro de cliente</b>
</center>

<form name="formRegistro" method="post" action="registro.asp">
<table width="50%" align="center">

<tr>

<td>

Nombre <input type="text" value="" name="nombre"><br>
Apellido
<input name="apellido" type="text" id="apellido" value="">
<br>
DNI
<input type="text" value="" name="dni"><br>
Ciudad
<input name="ciudad" type="text" id="ciudad" value="">
<br>
E-mail
<input type="text" value="" name="email">
<br>
Saludo
<textarea name="saludo" cols="30" rows="5" id="saludo"></textarea>
<br>

</td>

</tr>
<tr>

<td align="center">
<bR><input type="submit" value="Enviar">&nbsp;&nbsp;<input type="reset" value="Borrar">
</td>

</tr>

</table>
</form>
</body>
</html>

-----------------------
registro.asp
-----------------------
<% if request.form <> "" then

dim nombre, apellido, dni, ciudad, email, saludo
nombre = Request.form("nombre")
apellido = Request.form("apellido")
dni = Request.form("dni")
ciudad = Request.form("ciudad")
email = Request.form("email")
saludo = Request.form("saludo")

%>
<html>

<head>

<title>Registro</title>

</head>
<body>

<% set Conexion=Server.CreateObject("ADODB.connection")
set Rs=Server.CreateObject("ADODB.Recordset")
set Rs1=Server.CreateObject("ADODB.Recordset")
COnexion.ConnectionString= "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("cumple1.mdb") + ";"
Conexion.open

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

'No hay nadie registrado con ese dni
Rs1.open "Participantes",Conexion,adOpenKeySet,adlockOptimi stic,adCmdTable
Rs1.AddNew
Rs1("nombre") = nombre
Rs1("apellido") = apellido
Rs1("dni") = dni
Rs1("ciudad") = ciudad
Rs1("email") = email
Rs1("saludo") = saludo
Rs1.Update
Rs1.close
Rs.close
Conexion.close
set Rs1= nothing
set Rs = nothing
set Conexion = nothing
Response.redirect "registroOk.html"

else

'El participante ya existe
Rs.close
Conexion.close
set Rs = nothing
set Conexion = nothing
Response.redirect "registroCancelado.html"

end if
%>
</body>

</html>
<%

end if
%>

--------------------------------

las otras (registroOK.htm y registroCancelado.htm) las dejé igual, sin cambios.

agradecería tu ayuda.

saludos.