ErodeGrigo
14-05-2009, 10:10
Non riesco a capire,come faccio faccio mi restituisce sempre errore.
Nun si riesce a fare sta cavolo di insert nel database. (Sto con IIS7).
Questo è il codice della pagina che inserisce i dati.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Inserimento Cliente</title>
</head>
<body>
<%
Set connessioneDB = Server.CreateObject("ADODB.Connection")
connessioneDB.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/pranzionline/db/pranzionline.mdb")
QueryINSERT = "INSERT INTO clienti(username, cognomenome, indirizzo, tipopagamento, password) "
QueryINSERT = QueryINSERT & "VALUES ('"
QueryINSERT = QueryINSERT & Request.Form("txtUsername") & "','"
QueryINSERT = QueryINSERT & Request.Form("txtCognomeNome") & "','"
QueryINSERT = QueryINSERT & Request.Form("txtIndirizzo") & "','"
QueryINSERT = QueryINSERT & Request.Form("optTipoPagamento") & "','"
QueryINSERT = QueryINSERT & Request.Form("txtPassword") & "');"
'RecordModificati = 1
'On Error Resume Next
'connessioneDB.Execute QueryINSERT, RecordModificati
connessioneDB.Execute QueryINSERT
connessioneDB.Close
Set connessioneDB = nothing
%>
<%
'IF RecordModificati = 1 THEN
Response.Write "<b>Grazie</b> I tuoi dati sono stati inseriti correttamente."
'ELSE
'Response.Write "<b>Errore</b> Riprova ad inserire i tuoi dati con uno user diverso."
'END IF
'Session.Abandon()
%>
</body>
</html>
L'errore è:
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
La cosa bella è che una select me la fa tranquillamente, il codice è lo stesso cambia solo la stringa sql.
Nun si riesce a fare sta cavolo di insert nel database. (Sto con IIS7).
Questo è il codice della pagina che inserisce i dati.
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Inserimento Cliente</title>
</head>
<body>
<%
Set connessioneDB = Server.CreateObject("ADODB.Connection")
connessioneDB.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/pranzionline/db/pranzionline.mdb")
QueryINSERT = "INSERT INTO clienti(username, cognomenome, indirizzo, tipopagamento, password) "
QueryINSERT = QueryINSERT & "VALUES ('"
QueryINSERT = QueryINSERT & Request.Form("txtUsername") & "','"
QueryINSERT = QueryINSERT & Request.Form("txtCognomeNome") & "','"
QueryINSERT = QueryINSERT & Request.Form("txtIndirizzo") & "','"
QueryINSERT = QueryINSERT & Request.Form("optTipoPagamento") & "','"
QueryINSERT = QueryINSERT & Request.Form("txtPassword") & "');"
'RecordModificati = 1
'On Error Resume Next
'connessioneDB.Execute QueryINSERT, RecordModificati
connessioneDB.Execute QueryINSERT
connessioneDB.Close
Set connessioneDB = nothing
%>
<%
'IF RecordModificati = 1 THEN
Response.Write "<b>Grazie</b> I tuoi dati sono stati inseriti correttamente."
'ELSE
'Response.Write "<b>Errore</b> Riprova ad inserire i tuoi dati con uno user diverso."
'END IF
'Session.Abandon()
%>
</body>
</html>
L'errore è:
An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
La cosa bella è che una select me la fa tranquillamente, il codice è lo stesso cambia solo la stringa sql.