1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| <%@ Language="VBScript" %>
<% Option Explicit %>
<html>
<head>
<title>Insert into database</title>
</head>
<body>
<%
Dim dbname
Dim conntemp, cnpath, SQLtemp, RStemp,Submit
If Session("LoggedIn") <> "yes" Then
Session("Message") = "Vous devez vous connecter pour voir cette page."
Response.Redirect "login.asp"
End If
article =session("article")
nom=session("nom")
date_reception=session("date_reception)
heure_reception=session("heure_reception)
objet=session("objet")
observation=session("obsevation")
Submit=Request.Form("sauvegarder")
dbname="rendezv.mdb"
Set conntemp=Server.CreateObject("adodb.connection")
cnpath="DBQ=" & Server.MapPath(dbname)
conntemp.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & cnpath
if Submit="sauvegarder" then
SQLtemp="INSERT INTO tanfa(article,nom,date_reception,heure_reception,objet,observation) VALUES('"&article&"','"&nom&"','"&date_reception&"','"&heure_reception&"','"&objet&"','"&observation&"')"
RStemp=conntemp.execute(SQLTemp)
end if
%>
Response.Write "vos données ont été ajoutées à la base de données"
conntemp.Close
%>
</body>
</html> |
Partager