Ho un piccolo problemino con una pagina di controllo ASP.
Codice:

<%Response.Expires = -1 %>
<%Response.ExpiresAbsolute = Now() - 1 %>
<%Response.AddHeader "pragma", "no-cache" %>
<%Response.AddHeader "cache-control", "private" %>
<%Response.CacheControl = "no-cache" %>
<%
Response.Expires = -1000
Response.Buffer = True
Response.Clear
%>
<%
Function CheckEmail(str)
Dim objER, result
Set objER = New RegExp
objER.Global = True
objER.IgnoreCase = True
objER.Pattern = "^[a-z0-9._-]+\@[a-z0-9._-]+\.[a-z]{2,4}$"
result = objER.Test(str)
Set objER = Nothing
CheckEmail = result
if CheckEmail = false then
CheckEmail = result2
else
CheckEmail = ""
end if
End Function
%>

<%
Dim id1
id1=request.querystring("id")
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & server.mappath("/mdb-database/vuoto.mdb")
Dim rs
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "select * from tabella where id ="&id1, conn, 3, 3
Dim tom, pre, ven, vis, off
tom=rs("tom")
pre=rs("Prezzo")
ven=rs("Venditore")
vis=rs("Vis")
off=rs("Off")
rs.Close
Set rs = Nothing
Conn.Close
Set Conn = Nothing
%>

<%
If Request.QueryString("step") = 2 Then
Dim Offerta, txtOfferta, txtEmail, txtNick, strData
Offerta = Request.Form("Offerta")
txtOfferta = Request.Form("txtOfferta")
txtEmai = Request.Form("txtEmail")
txtNick = Request.Form("txtNick")

strData = Now()
Dim errore, caratnonval, result2, campobb, min6car, min3car, deviacc, nickerrore, emailerrore, erroreofferta
errore = 0

caratnonval = "<span style=""color: #FF0000;"">Carattere non valido! "
result2 = "<span style=""color: #FF0000;"">Email non valida! "
campobb = "<span style=""color: #FF0000;"">Campo obbligatorio! "
min6car= "<span style=""color: #FF0000;"">Minimo 6 caratteri! "
min3car = "<span style=""color: #FF0000;"">Minimo 3 caratteri! "
deviacc = "<span style=""color: #FF0000;"">Devi accettare! "
nickerrore ="<span style=""color: #FF0000;"">NickName già in uso! "
emailerrore ="<span style=""color: #FF0000;"">Email già in uso! "
erroreofferta ="<span style=""color: #FF0000;"">Non puoi offrire di meno! "
end if
%>

<html>

<head>
<title> Offri</title>
<script type="text/vbscript">
Function svuotacampi()
document.FormOfferta.txtOfferta.value=""
document.FormOfferta.txtEmail.value=""
document.FormOfferta.txtNick.value=""
End Function
</script>
</head>
<body topmargin="0">
<h3>Fai la tua offerta </h3>
<p align="justify">Stai per fare la tua offerta : <font size=5 color=#0000FF><%response.write(tom)%></font>

<align="justify">Registrato : <font size=5 color=#0000FF><%response.write(ven)%></font>

<align="justify">Prezzo : <font size=5 color=#0000FF><%response.write(pre)%>,00 euro
</font> </p>

<form action="offri.asp?step=2" method="POST" name="FormOfferta" >
<table width="100%">
<tr> <td width="50%">
La Tua Offerta :
<% If Offerta <> "" And len(txtOfferta) <> "" Then
Response.Write numerica(txtOfferta)
errore = errore + 1
end if
%>

<input align="right" type="text" name="txtOfferta" value="<%=txtOfferta%>" size="10" maxlength="10"> <font color="#000000">,00 euro</font>
</td>
<td width="50%"> La Tua Email :
<% If Offerta <> "" And len(txtEmail) <=6 Then
Response.Write campobb
errore = errore + 1
End If
If Offerta <> "" And len(txtEmail) >= 7 Then
Response.Write CheckEmail(txtEmail)
End If
%>

<input type="text" name="txtEmail" value="<%=txtEmail%>" size="38" maxlength="35">
</td></tr>
<tr><td width="50%">

Il Tuo Nick se registrato :
<% If Offerta <> "" and len(txtNick) <= 5 then
Response.Write min6car
errore = errore + 1
end If
If Offerta <> "" and len(txtNick) >= 6 then
Response.Write alfanumpic(txtNick)
End If
%>

<input type="text" name="txtNick" value="<%=txtNick%>" size="20">

</td></tr>
</table>


<input type="submit" name="Offerta" value="Invia Offerta" >
<input type="button" value="Cancella Dati" name="Cancella" onClick="svuotacampi()">

</td>
</form>

<% response.write errore
If Offerta <> "" And errore = 0 Then

txtOfferta = Request.Form("txtOfferta")
txtEmai = Request.Form("txtEmail")
txtNick = Request.Form("txtNick")
response.redirect "offerta.asp"

end if
%>
</body>

------------------ fine codice
Inserendo lo step "Impossibile visualizzare la pagina"
Se tolgo la prima chiamata al DB posso andare avanti ma non ho i dati che mi servono.
Se tolgo la funzione CheckMail mi passa anche email sbagliate.
Quello che vorrei :
carico il DB con i dati che mi servono,
stampo la pagina html con i campi in attesa dell'utente,
al submit passo il controllo alle funzioni, es. CheckMail, per la correzione dei vari campi,
se tutto corretto redirect alla pagina offerta.
In altre pagine lo "step 2" funziona a meraviglia, senza però nessun richiamo a DB prima dello step, può essere un conflitto tra i due sistemi?
Le pagine sono ASP, il database Access.
Grazie
Daniele