<% Response.buffer=True If Session("LoginName") = "" then Response.redirect "login.asp?Redirect=" &Request.Servervariables("URL") End If %>
   Ajouter une catégorie 
Esplanade Parmentier
62600 Berck-sur-Mer 
Tél : 03.21.09.21.21   
Fax : 03.21.09.29.29   
<% dim adoCn dim adoRs dim strSQL dim strSQLInsert dim strCatName Dim strCatDescription select case request.queryString("action") ' AddCategory case "addCat" Set adoCn = Server.CreateObject("ADODB.Connection") Set adoRs = Server.CreateObject("ADODB.Recordset") adoCn.Open strConn strCatName = request.form("txtCatName") strSQL = "SELECT CatName from Category where CatName='"& strCatName &"'" adoRs.Open strSQL, adoCn if adoRs.eof and adoRs.bof then strSQLInsert= "insert into Category(CatName) values('" &_ strCatName &_ "')" adoCn.execute(strSQLInsert) response.write "
La catégorie " & strCatName & " a été ajouté
" else response.write "Cette catégorie existe déjà. Choisissez un autre nom de catégorie." end if end select %>
Nom de la catégorie :