Prb en asp aide moi
amira01
Messages postés
54
Statut
Membre
-
amira01 -
amira01 -
salut tous le monde
voil je veux réaliser un page web qui contine un tableaue (Reference,diecreption,prix....)
les information sont stocke donnes un base de donner (esc.mdb)
voila mon code
<html>
<head>
DSN_BASE = "DBQ=" & Server.Mappath("esc.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25"
Set ConnAfficheRef = Server.CreateObject("ADODB.Connection")
ConnAfficheRef.Open DSN_BASE
Set RsAfficheRef = Server.CreateObject("ADODB.Recordset")
RsAfficheRef.open"select.*from materil ORDER BY Ref",ConnAfficheRef
<%if RsAfficheRef .eof = false then%>
</head>
<body>
<table>
<tr>
<td>Ref</td>
<td>Destination</td>
<td>description</td>
<td>prix</td>
</tr>
compteur=0
<%rsAfficheRef.MoveFirst
DO WHILE not rsAfficheRef.eof%>
<tr>
<td><B><%= rsAfficheRef("reference")%></B></td>
<td><%= rsAfficheRef("Destination")%></td>
<td><%= rsAfficheRef("description")%></td>
<td><%= rsAfficheRef("prix")%></td>
</tr>
compteur=compteur+1
<%rsAfficheLots.MoveNext
loop%>
</table>
<endif>
</body>
</html>
aide moi je saie que ce code continer des faute c'est la premier fois que je travaille avac asp
svp aide moi
voil je veux réaliser un page web qui contine un tableaue (Reference,diecreption,prix....)
les information sont stocke donnes un base de donner (esc.mdb)
voila mon code
<html>
<head>
DSN_BASE = "DBQ=" & Server.Mappath("esc.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25"
Set ConnAfficheRef = Server.CreateObject("ADODB.Connection")
ConnAfficheRef.Open DSN_BASE
Set RsAfficheRef = Server.CreateObject("ADODB.Recordset")
RsAfficheRef.open"select.*from materil ORDER BY Ref",ConnAfficheRef
<%if RsAfficheRef .eof = false then%>
</head>
<body>
<table>
<tr>
<td>Ref</td>
<td>Destination</td>
<td>description</td>
<td>prix</td>
</tr>
compteur=0
<%rsAfficheRef.MoveFirst
DO WHILE not rsAfficheRef.eof%>
<tr>
<td><B><%= rsAfficheRef("reference")%></B></td>
<td><%= rsAfficheRef("Destination")%></td>
<td><%= rsAfficheRef("description")%></td>
<td><%= rsAfficheRef("prix")%></td>
</tr>
compteur=compteur+1
<%rsAfficheLots.MoveNext
loop%>
</table>
<endif>
</body>
</html>
aide moi je saie que ce code continer des faute c'est la premier fois que je travaille avac asp
svp aide moi
A voir également:
- Prb en asp aide moi
- Logiciel asp - Télécharger - Gestion de données
- Asp .net download - Télécharger - Divers Web & Internet
- Afficher variable sous asp? - Forum Programmation
- Asp net machine account - Forum Windows
- Application Service Provider (ASP) - Forum Windows
2 réponses
Hello,
voici un aurte code qui fait à peu près la même chose :
<%
fp_sNoRecords = "Aucun enregistrement n'a été trouvé dans la base"
Dim RS
ConnectionString = "dsn=nomdudsn"
fp_sQry = "select * from brochure"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open fp_sQry, ConnectionString
If RS.EOF And RS.BOF Then
Response.Write fp_sNoRecords
Else
%>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr align="center" bgcolor="#ffcc33">
<td bgcolor="#99FF00"><b>Genre</b></td>
<td bgcolor="#99FF00"><b>Prénom - Nom<br>
e-mail </b></td>
<td bgcolor="#FF99FF"><b>adresse</b></td>
<td bgcolor="#FF99FF"><b>Tel / Fax</b></td>
<td bgcolor="#99FFCC">
<p><b> Brochure</b> /<br>
<b>Envoyée le</b></p>
</td>
<td bgcolor="#99FFCC"><b>Op</b></td>
</tr>
<% do while not RS.EOF %>
<tr>
<td valign="top">
<%if RS("genre").value=1 then
response.write "M."
elseif RS("genre").value=2 then
response.write "Mme"
else response.write "Melle"
end if
%>
</td>
<td valign="top"><%=RS("prenom").value%> <%=RS("nom").value%><br>
<%=RS("email").value%></td>
<td valign="top"><%=RS("adresse").value%><br>
<%=RS("adresse2").value%><br>
<%=RS("codepostal").value%> <%=RS("ville").value%> </td>
<td valign="top"><%=RS("telephone").value%><br>
<%=RS("fax").value%> </td>
<td valign="top"><%=RS("AskBrochure").value%><br>
<%=RS("SentBrochure").value%> </td>
<td>
<input type="checkbox" name="checkbox" value="checkbox">
</td>
</tr>
<%
RS.movenext
Loop
end if
%>
</table>
<%
end if 'du codeop=1
%>
voici un aurte code qui fait à peu près la même chose :
<%
fp_sNoRecords = "Aucun enregistrement n'a été trouvé dans la base"
Dim RS
ConnectionString = "dsn=nomdudsn"
fp_sQry = "select * from brochure"
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open fp_sQry, ConnectionString
If RS.EOF And RS.BOF Then
Response.Write fp_sNoRecords
Else
%>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
<tr align="center" bgcolor="#ffcc33">
<td bgcolor="#99FF00"><b>Genre</b></td>
<td bgcolor="#99FF00"><b>Prénom - Nom<br>
e-mail </b></td>
<td bgcolor="#FF99FF"><b>adresse</b></td>
<td bgcolor="#FF99FF"><b>Tel / Fax</b></td>
<td bgcolor="#99FFCC">
<p><b> Brochure</b> /<br>
<b>Envoyée le</b></p>
</td>
<td bgcolor="#99FFCC"><b>Op</b></td>
</tr>
<% do while not RS.EOF %>
<tr>
<td valign="top">
<%if RS("genre").value=1 then
response.write "M."
elseif RS("genre").value=2 then
response.write "Mme"
else response.write "Melle"
end if
%>
</td>
<td valign="top"><%=RS("prenom").value%> <%=RS("nom").value%><br>
<%=RS("email").value%></td>
<td valign="top"><%=RS("adresse").value%><br>
<%=RS("adresse2").value%><br>
<%=RS("codepostal").value%> <%=RS("ville").value%> </td>
<td valign="top"><%=RS("telephone").value%><br>
<%=RS("fax").value%> </td>
<td valign="top"><%=RS("AskBrochure").value%><br>
<%=RS("SentBrochure").value%> </td>
<td>
<input type="checkbox" name="checkbox" value="checkbox">
</td>
</tr>
<%
RS.movenext
Loop
end if
%>
</table>
<%
end if 'du codeop=1
%>