PORQUE ESTE CODIGO GENERA UN ERROR
Publicado por PEDRO ACOSTA (1 intervención) el 13/03/2001 19:05:20
<%@ LANGUAGE=VBScript %>
<html>
<body>
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub btnEnter_OnClick
Dim TheForm, paso
pago = ""
Set TheForm = Document.MyForm
If Not IsNumeric(TheForm.Edad.Value) Then
paso = "Tiene que Introducir su Edad"
msgbox paso
end if
If IsEmpty(TheForm.mail.Value) Then
paso = "Tiene que Introducir su E-mail"
msgbox paso
End if
If IsEmpty(TheForm.name.Value) Then
paso = "Tiene que Introducir su Nombre"
msgbox paso
End if
If IsEmpty(TheForm.ciudad.Value) Then
paso = "Tiene que Introducir su Ciudad"
msgbox paso
End if
If IsEmpty(paso) then
dim cnn, rs
set cnn = Server.CreateObject("ADODB.Connection")
' cnn.open "DRIVER={Microsoft Access Driver(*.mdb)}; " & "DBQ="& Server.Mappath("dbdatos.mdb")
' set rs = cnn.Execute("Select * from Student")
theform.submit
end if
End Sub
</SCRIPT>
<TABLE border=1 cellPadding=1 cellSpacing=1 width="75%">
<FORM METHOD= "post" NAME= MyForm ACTION="" >
<TR><TD>Nombre: </TD><TD><INPUT size="40" NAME = "Name" ></TD></TR>
<TR><TD>Dirección </TD><TD><INPUT size="40" NAME = "dire" ></TD></TR>
<TR><TD>Ciudad </TD><TD><INPUT size="30" NAME = "ciudad" ></TD></TR>
<TR><TD>E-mail </TD><TD><INPUT size="40" NAME = "mail" ></TD></TR>
<html>
<body>
<SCRIPT LANGUAGE="VBScript" RUNAT="Server">
Sub btnEnter_OnClick
Dim TheForm, paso
pago = ""
Set TheForm = Document.MyForm
If Not IsNumeric(TheForm.Edad.Value) Then
paso = "Tiene que Introducir su Edad"
msgbox paso
end if
If IsEmpty(TheForm.mail.Value) Then
paso = "Tiene que Introducir su E-mail"
msgbox paso
End if
If IsEmpty(TheForm.name.Value) Then
paso = "Tiene que Introducir su Nombre"
msgbox paso
End if
If IsEmpty(TheForm.ciudad.Value) Then
paso = "Tiene que Introducir su Ciudad"
msgbox paso
End if
If IsEmpty(paso) then
dim cnn, rs
set cnn = Server.CreateObject("ADODB.Connection")
' cnn.open "DRIVER={Microsoft Access Driver(*.mdb)}; " & "DBQ="& Server.Mappath("dbdatos.mdb")
' set rs = cnn.Execute("Select * from Student")
theform.submit
end if
End Sub
</SCRIPT>
<TABLE border=1 cellPadding=1 cellSpacing=1 width="75%">
<FORM METHOD= "post" NAME= MyForm ACTION="" >
<TR><TD>Nombre: </TD><TD><INPUT size="40" NAME = "Name" ></TD></TR>
<TR><TD>Dirección </TD><TD><INPUT size="40" NAME = "dire" ></TD></TR>
<TR><TD>Ciudad </TD><TD><INPUT size="30" NAME = "ciudad" ></TD></TR>
<TR><TD>E-mail </TD><TD><INPUT size="40" NAME = "mail" ></TD></TR>
Valora esta pregunta
0