Voila j'ai un formulaire de saisie HTML qui lorsque on clique sur un bouton m'envoie vers une page ASP
Seulement lorsque j'appuie sur le bouton, apres un bon moment une page de type "the page cannot be displayed " apparait avec comme error type timeout
Voila le code de ma page ASP
<% ' Date de création: 10/01/2006 %>
<html>
<body>
<!--#include file="fonctions.asp"-->
<%
On Error Resume Next
err=0
'Test les champs obligatoires
'----------------------------
if trim(request("nom_inter"))="" OR trim(request("pnom_inter"))="" OR trim(request("tel_inter"))="" OR trim(request("nom_invit"))="" OR trim(request("date_rep"))="" OR trim(request("nb_couv_prev"))="" OR trim(request("salon"))="selectionnez" OR trim(request("type_rep"))="selectionnez" then
call AfficheMessage("Erreur utilisateur","Attention les champs en rouges sont obligatoires !","","")
response.end
end if
'Chargement des objets ADO
'-------------------------
set conn=Server.createObject("ADODB.Connection")
set res=Server.createObject("ADODB.Recordset")
set invit=Server.createObject("ADODB.Recordset")
set inter=Server.createObject("ADODB.Recordset")
set typrep=Server.createObject("ADODB.Recordset")
set effectuer=Server.createObject("ADODB.Recordset")
set organisme=Server.createObject("ADODB.Recordset")
set Lesalon=Server.createObject("ADODB.Recordset")
'Ouverture de la connexion
'-------------------------
conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & "DBQ=" & Server.mappath(".") & "/RepasMutuel.mdb"
if err<>0 then
Call AfficheMessage("Erreur Open Connection",err.description,"creer_reservation","")
response.end
end if
'Initialisation de la requête
'----------------------------
res.Open "SELECT * FROM _RESERVATION",conn,adOpenKeyset,adLockOptimistic
invit.Open "SELECT * FROM _INVITANT",conn,adOpenKeyset,adLockOptimistic
inter.Open "SELECT * FROM _INTERMEDIAIRE",conn,adOpenKeyset,adLockOptimistic
typrep.Open "SELECT * FROM _TYPE_REPAS",conn,adOpenKeyset,adLockOptimistic
effectuer.Open "SELECT * FROM _EFFECTUER",conn,adOpenKeyset,adLockOptimistic
organisme.Open "SELECT * FROM _ORGANISME",conn,adOpenKeyset,adLockOptimistic
Lesalon.Open "SELECT * FROM _SALON",conn,adOpenKeyset,adLockOptimistic
Lesalon.movefirst
numsal=0
while Lesalon.eof<>false and trim(request("salon"))<>"Autre"
if Lesalon.Fields("LIB")=trim(request("salon")) then
numsal=Lesalon.Fields("ID_SALON")
Lesalon.movelast
Else
Lesalon.movenext
End if
Wend
nom_sal=trim(request("salon"))
If trim(request("salon"))="Autre" then
SQL="INSERT INTO _SALON(LIB) VALUES (nom_sal)"
conn.Execute(SQL)
Lesalon.movelast
numsal=Lesalon.Fields("ID_SALON")
End if
organisme.movefirst
numorg=0
nom_org=trim(request("org"))
if trim(request("org"))="" then
numorg=""
Else
While not organisme.eof
if organisme.Fields("LIB")=trim(request("org")) then
numorg=organisme.Fields("ID_SALON")
organisme.movelast
Else
organisme.movenext
End if
Wend
if numorg=0 then
SQL="INSERT INTO _ORGANISME(LIB) VALUES(nom_org)"
conn.Execute(SQL)
organisme.movelast
numorg=organisme.Fields("ID_ORGANISME")
End if
end if
typrep.movefirst
numrep=0
While not typrep.eof
if typrep.Fields("LIB")=trim(request("type_rep")) then
numrep=typrep.Fields("ID_TYPE_REPAS")
typrep.movelast
Else
typrep.movenext
End if
Wend
invit.movefirst
numinvit=0
nom_invit=trim(request("nom_invit"))
code_budgetaire=trim(request("code_budg"))
While not invit.eof
if invit.Fields("NOM")=trim(request("nom_invit")) then
numinvit=invit.Fields("ID_INVITANT")
invit.movelast
Else
invit.movenext
End if
Wend
If numinvit=0 then
SQL="INSERT INTO _INVITANT(NOM,REF_ORGANISME,CODE_BUDGETAIRE) VALUES(nom_invit,numorg,code_budgetaire)"
conn.Execute(SQL)
invit.movelast
numinvit=invit.Fields("ID_INVITANT")
End if
inter.movefirst
numinter=0
nom_intermed=trim(request("nom_inter"))
pnom_intermed=trim(request("pnom_inter"))
tel_intermed=trim(request("tel_inter"))
While not inter.eof
if inter.Fields("NOM")=trim(request("nom_inter")) and inter.Fields("PNOM")=trim(request("pnom_inter")) and inter.Fields("TEL")=trim(request("tel_inter")) then
numinter=inter.Fields("ID_INTERMEDIAIRE")
inter.movelast
Else
inter.movenext
End if
Wend
If numinter=0 then
SQL="INSERT INTO _INTERMEDIAIRE(NOM,PNOM,TEL,REF_INVITANT) VALUES(nom_inter,pnom_inter,tel_inter,numinvit)"
conn.Execute(SQL)
inter.movelast
numinter=inter.Fields("ID_INTERMEDAIRE")
End if
SQL="INSERT INTO _EFFECTUER(REF_RESERVATION,REF_INTERMEDIAIRE) VALUES(numres,numinter)"
conn.Execute(SQL)
res.Update
res.close
set res=nothing
effectuer.Update
effectuer.close
set effectuer=nothing
typrep.Update
typrep.close
set typrep=nothing
Lesalon.Update
Lesalon.close
set Lesalon=nothing
invit.Update
invit.close
set invit=nothing
inter.Update
inter.close
set inter=nothing
org.Update
org.close
set org=nothing
conn.close
set conn=nothing
' Message de bon déroulement
'---------------------------
Call AfficheMessage("Enregistrement réservation","La réservation a bien été enregistrer.","","N'oubliez pas de confirmer votre réservation au maximum un jour avant la date du repas. Votre numéro de réservation est " & numres & ". Veillez à garder ce numéro il vous sera demandé lors de votre confirmation.")
%>
</body>
</html>
et voici le code de ma fonction affichemessage
<%
'Fichier fonctions.asp contenant des fonctions communes aux différents scripts
' ****************************************************************
'Fonction d'affichage des messages d'erreur
' -------------------------------------
Function AfficheMessage(titre,description,appel,remarque)
response.write "<html> <head> <title> Message d'erreur</title></head>"
response.write "<body bgcolor='#FFFFFF'>"
response.write "<table width='70%' border='1' align='center' bordercolor='#000000'>"
response.write "<tr bgcolor='#FFCCCC' bordercolor='#000000'>"
response.write "<td><div align='center'><b>" & titre & "</b></div></td></tr>"
response.write "<tr bordercolor='#FFFFFF'>"
response.write "<td>" & description & "</td></tr>"
response.write "<tr bordercolor='#FFFFFF'>"
response.write "<td>" & appel & "</td></tr>"
response.write "<tr bordercolor='#FFFFFF'>"
response.write "<td>" & remarque & "</td></tr>"
response.write "</tr></table></body></html>"
End Function
%>