Questo e' il codice di index.asp che richiama modifica.asp col tasto "Salva":
<%@ Language=VBScript %>
<% Option Explicit
Dim check, objConn, objRS, objRS2, rec, strSQL
'
check = 0
rec = 1
'
if trim(request("rec"))<>"" then rec = Request("rec")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>SSD</title>
<Script Language="JavaScript">
function notify(n) {
if (n==0) {
var answer = confirm("Salvare le modifiche?")
if (answer) {
document.FrontPage_Form.action = "modifica.asp"
document.FrontPage_Form.submit();
return true; } }
else if (n==1) {
var answer = confirm("Crea un nuovo Prog.")
if (answer) {
document.FrontPage_Form.action = "inserisci.asp"
document.FrontPage_Form.submit();
return true; } }
}
</script>
</head>
<body>
<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "DSN=ssd09.dsn"
objConn.Open
'
Set objRS2 = Server.CreateObject("ADODB.Recordset")
objRS2.Open "t_check", objConn, , 3, 2
Do While Not objRS2.EOF
If (objRS2("Numero") = Cint(rec)) Then
strSQL = "SELECT * FROM t_check WHERE Numero = " & rec
Set objRS = objConn.Execute(strSQL)
check = check + 1
End If
objRS2.MoveNext
Loop
If (check = 0) Then
rec = 1
strSQL = "SELECT * FROM t_check WHERE Numero = " & rec
Set objRS = objConn.Execute(strSQL)
End If
'
%>
<div align="center">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border-left-width:0; border-right-width:0; border-bottom-width:0; border-top-width:0px" bordercolor="#111111" id="AutoNumber1" height="0" width="850">
<tr>
<form method="POST" action="inserisci.asp" webbot-onSubmit language="JavaScript" name="FrontPage_Form">
..........................................
<td
style="border-style:none; border-width:medium; " valign="top">
<p align="left" style="margin-top: 12px">
<input type="text" id="rec_mod" name="rec_mod" value="<%=objRS("Numero")%>" size="8" style="text-align: center; font-family: Gill Sans MT; font-size: 10 pt; background-color:#E6E6FA" maxlength="5""></td>
.................................................. ...
</form></table>
</center>
</div>
<%
objRS.Close
objRS2.Close
objConn.Close
Set objConn = Nothing
%>
</div>
</body>
</html>