Sataneo85 | Bonjour tout le monde je suis actuellement en stage et je dois créer un formulaire d'enquete pour un service informatique.
Je m'en remet a vous car je ne comprend pas l'erreur.
Mise à jour impossible. La base de données ou l'objet est en lecture seule
Je précise que la bd n'est pas en lecture seule et n'est pas ouverte.
erreur ligne 311 > rs.update
pour moi l'erreur viendrais donc de la connexion, merci de vous pencher sur mon problème
Code :
- <html>
- <head>
- <title>Enquête de satisfaction</title>
- <style type="text/css">
- <!--
- .Style1 {
- font-family: Verdana, Arial, Helvetica, sans-serif;
- font-size: 12px;
- }
- .Style2 {font-family: Verdana, Arial, Helvetica, sans-serif}
- .Style3 {
- font-size: 9px;
- font-style: italic;
- }
- .Style5 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; }
- .Style7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 9px; font-style: italic; }
- -->
- </style>
- </head>
- <body>
- <table width="710" border="" bordercolor="#000000" align="center" cellpadding="0" cellspacing="0"><td>
- <form name="form1" method="post" action="">
- <%Set wshNetwork=CreateObject("Wscript.Network" )%>
- <%
- function Msgbox(texte)
- 'Fonction Msgbox par clem2k@fr.st
- 'On vire les ' qui en JS peuvent planter !
- texte=replace(texte,"'","''" )
- %>
- <script>
- alert('<%=texte%>');
- </script>
- <%
- end function
- %>
- <%
- if request ("question1" ) = "1" then
- a1 = "checked"
- elseif request ("question1" ) = "2" then
- b1 = "checked"
- elseif request ("question1" ) = "3" then
- c1 = "checked"
- elseif request ("question1" ) = "4" then
- d1 = "checked"
- end if
- %>
- <%
- if request ("question2" ) = "1" then
- a2 = "checked"
- elseif request ("question2" ) = "2" then
- b2 = "checked"
- elseif request ("question2" ) = "3" then
- c2 = "checked"
- elseif request ("question2" ) = "4" then
- d2 = "checked"
- end if
- %>
- <%
- if request ("question3" ) = "1" then
- a3 = "checked"
- elseif request ("question3" ) = "2" then
- b3 = "checked"
- elseif request ("question3" ) = "3" then
- c3 = "checked"
- elseif request ("question3" ) = "4" then
- d3 = "checked"
- end if
- %>
- <%
- if request ("question4" ) = "1" then
- a4 = "checked"
- elseif request ("question4" ) = "2" then
- b4 = "checked"
- elseif request ("question4" ) = "3" then
- c4 = "checked"
- elseif request ("question4" ) = "4" then
- d4 = "checked"
- end if
- %>
- <%
- if request ("question5" ) = "1" then
- a5 = "checked"
- elseif request ("question5" ) = "2" then
- b5 = "checked"
- elseif request ("question5" ) = "3" then
- c5 = "checked"
- elseif request ("question5" ) = "4" then
- d5 = "checked"
- end if
- %>
- <%
- if request ("question6" ) = "1" then
- a6 = "checked"
- elseif request ("question6" ) = "2" then
- b6 = "checked"
- elseif request ("question6" ) = "3" then
- c6 = "checked"
- elseif request ("question6" ) = "4" then
- d6 = "checked"
- end if
- %>
- <%
- if request ("question7" ) = "1" then
- a7 = "checked"
- elseif request ("question7" ) = "2" then
- b7 = "checked"
- elseif request ("question7" ) = "3" then
- c7 = "checked"
- elseif request ("question7" ) = "4" then
- d7 = "checked"
- end if
- %>
- <p align="center" class="Style1"><br>
- <img src="header.jpg" width="417" height="107"></p>
- <p align="center" class="Style1"></p>
- <table width="685" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td width="685" bgcolor="#CED1D5"><div align="center" class="Style2"><strong>Merci de prendre quelques secondes pour répondre
- à ce questionnaire. </strong><br>
- <span class="Style3">Cocher les cases ci-dessous puis cliquer sur le bouton "envoyer'"</span></div></td>
- </tr>
- </table>
- <br>
- <br>
- <table width="685" height="73" border="0" cellpadding="1" cellspacing="2" align="center">
- <tr>
- <td width="258" class="Style1"></td>
- <td width="104" bgcolor="#DEE0E2" class="Style1"><div align="center"><strong>Très satisfaisant</strong></div></td>
- <td width="80" bgcolor="#DEE0E2" class="Style1"><div align="center"><strong>Satisfaisant</strong></div></td>
- <td width="106" bgcolor="#DEE0E2" class="Style1"><div align="center"><strong>Peu satisfaisant </strong></div></td>
- <td width="109" bgcolor="#DEE0E2" class="Style1"><div align="center"><strong>Insatisfaisant</strong></div></td>
- </tr>
- <tr>
- <td bgcolor="#DEE0E2" class="Style1"><strong>La facilité pour nous contacter ? </strong></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question1" value="1" <%=a1%> >
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question1" value="2" <%=b1%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question1" value="3" <%=c1%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1">
- <div align="center">
- <input type="radio" name="question1" value="4" <%=d1%>>
- </div></td>
- </tr>
- <tr>
- <td bgcolor="#DEE0E2" class="Style1"><strong>La qualité de l'accueil téléphonique ? </strong></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question2" value="1" <%=a2%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question2" value="2" <%=b2%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question2" value="3" <%=c2%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1">
- <div align="center">
- <input type="radio" name="question2" value="4" <%=d2%>>
- </div></td>
- </tr>
- <tr>
- <td bgcolor="#DEE0E2" class="Style1"><strong>Vos relations avec le technicien ? </strong></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question3" value="1" <%=a3%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question3" value="2" <%=b3%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question3" value="3" <%=c3%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1">
- <div align="center">
- <input type="radio" name="question3" value="4" <%=d3%>>
- </div></td>
- </tr>
- <tr>
- <td bgcolor="#DEE0E2" class="Style1"><strong>La qualité de la réponse à votre problème?</strong></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question4" value="1" <%=a4%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question4" value="2" <%=b4%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question4" value="3" <%=c4%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1">
- <div align="center">
- <input type="radio" name="question4" value="4" <%=d4%>>
- </div></td>
- </tr>
- <tr>
- <td bgcolor="#DEE0E2" class="Style1"><strong>Les délais de résolution ? </strong></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question5" value="1" <%=a5%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question5" value="2" <%=b5%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1"><div align="center">
- <input type="radio" name="question5" value="3" <%=c5%>>
- </div></td>
- <td bgcolor="#CED1D5" class="Style1">
- <div align="center">
- <input type="radio" name="question5" value="4" <%=d5%>>
- </div></td>
- </tr>
- </table>
- <br>
- <table width="626" border="0" align="center" cellpadding="1" cellspacing="2">
- <tr bgcolor="#DEE0E2">
- <td width="626" colspan="4" class="Style1"><div align="center"><strong>Pour quelle raison nous avez vous contacté ? </strong></div></td>
- </tr>
- <tr bgcolor="#CED1D5">
- <td class="Style1"><div align="center">
- <input type="radio" name="question6" value="1" <%=a6%>>
- Logiciel</div></td>
- <td class="Style1"><div align="center">
- <input type="radio" name="question6" value="2" <%=b6%>>
- Applicatif</div></td>
- <td class="Style1"><div align="center">
- <input type="radio" name="question6" value="3" <%=c6%>>
- Réseau</div></td>
- <td class="Style1">
- <div align="center">
- <input type="radio" name="question6" value="4" <%=d6%>>
- Matériel</div></td>
- </tr>
- </table>
- <table width="605" border="0" align="center" cellpadding="0" cellspacing="0">
- <tr>
- <td width="172"><span class="Style7"><strong>Logiciel</strong> : Word, Excel, Outlook ...</span></td>
- <td width="187"><span class="Style7"><strong>Applicatif</strong> : Comsys, Legacy, SAP ...</span></td>
- <td width="246"><span class="Style7"><strong>Matériel</strong> : Imprimante, PC ...</span></td>
- </tr>
- <tr>
- <td colspan="3"><div align="left"><em><span class="Style5"><strong>Réseau</strong> : Réinitialiser ou dévérouiller un mot de passe, accès aux répertoires ...</span></em></div></td>
- </tr>
- </table>
- <br>
- <table width="626" border="0" align="center" cellpadding="1" cellspacing="2">
- <tr bgcolor="#DEE0E2">
- <td width="626" colspan="4" class="Style1"><div align="center"><strong>D'une manière générale, les services offerts par Helpdesk vous donnent-ils satisfaction</strong>?</div></td>
- </tr>
- <tr bgcolor="#CED1D5">
- <td class="Style1"><div align="center">
- <input type="radio" name="question7" value="1" <%=a7%>>
- Très satisfaisant </div></td>
- <td class="Style1"><div align="center">
- <input type="radio" name="question7" value="2" <%=b7%>>
- Satisfaisant
- </div></td>
- <td class="Style1"><div align="center">
- <input type="radio" name="question7" value="3" <%=c7%>>
- Peu satisfaisant </div></td>
- <td class="Style1">
- <div align="center">
- <input type="radio" name="question7" value="4" <%=d7%>>
- Insatisfaisant</div></td>
- </tr>
- </table>
- <br>
- <div align="center">
- <table width="626" border="0" align="center" cellpadding="1" cellspacing="2">
- <tr bgcolor="#DEE0E2">
- <td width="626" class="Style1"><div align="center"><strong>Commentaire</strong></div></td>
- </tr>
- <tr bgcolor="#CED1D5">
- <td class="Style1"><div align="center">
- <p>
- <br>
- <textarea name="commentaire" cols=80 rows=4></textarea>
- <br>
- <br>
- </p>
- </div> </td>
- </tr>
- </table>
- <p> <input type="submit" name="Submit" value="Envoyer">
- <br>
- <%
- questions = (request ("question1" )) & (request ("question2" )) & (request ("question3" )) & (request ("question4" )) & (request ("question5" )) & (request ("question6" )) & (request ("question7" ))
- if questions = "" then
- 'rien
- else
- if len(questions) = "7" then
- dbPath=Server.MapPath("bd\satisfaction.mdb" )
- Set Conn=Server.createObject("ADODB.Connection" )
- Conn.open "DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=" & dbPath
- Set rs=server.createObject ("ADODB.recordset" )
- rs.Open "Tsatisfaction", conn, 1, 2 ,2 '( voir ouvrir et fermer une connexion à une basel )
- rs.Addnew
- rs.fields("question1" )=(request ("question1" ))
- rs.fields("question2" )=(request ("question2" ))
- rs.fields("question3" )=(request ("question3" ))
- rs.fields("question4" )=(request ("question4" ))
- rs.fields("question5" )=(request ("question5" ))
- rs.fields("question6" )=(request ("question6" ))
- rs.fields("question7" )=(request ("question7" ))
- rs.fields("commentaire" )=(request ("commentaire" ))
- rs.fields("date" )=now
- rs.fields("ip" )=Request.ServerVariables("REMOTE_ADDR" )
- rs.update
- rs.close
- set rs=nothing
- Conn.close
- Set conn=nothing
- response.redirect ("validavis.asp" )
- else
- Msgbox("Veuillez répondre à toutes les questions" )
- end if
- end if
- %>
- </p>
- </div>
- </form>
- </td></table>
- </body>
- </html>
|
|