Précédent   Forum des professionnels en informatique > Webmasters - Développement Web > Langages serveur > ASP
ASP Forum sur la programmation ASP. Avant de poster : Cours ASP, FAQ ASP
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 21/07/2006, 13h05   #1
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
Par défaut Code asp dans la base Access non interprété

Bonjour,
Pourquoi, lorsqu'on met du code asp dans un champ de la base Access, et qu'on demande à sa page asp de l'afficher, ne s'execute-t-il pas???
Le code html et même le javascript sont compris, mais la partie asp est inactive. Est-ce un problème d'interprétation de certains caractères?
Merci d'avance pour toute réponse.
Bonne journée.
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 13h15   #2
Membre régulier
 
Inscription : juillet 2005
Messages : 161
Détails du profil
Informations forums :
Inscription : juillet 2005
Messages : 161
Points : 92
Points : 92
Fais voir ton code affichant le champ contenant le code ASP.

Mais bon meme sans voir le code cela doit etre un problème client/serveur. Cela doit marcher pour le js et l'HTML car ils sont sur le client mais l'asp s'execute sur le serveur fais voir ton code quand meme...
Mateache est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 13h25   #3
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
voilà le code
Code :
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
 
<%DSN_BASE = "DBQ=" & Server.Mappath("../bd/sl_usuels.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};DriverId=25"
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open DSN_BASE
%>
<html>
<head>
<title>Proposition d'achat</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.button                  { color: black; font-size: 10pt; line-height: 12pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #c2c2c2; border: solid 1px black }
.textfeld        { color: black; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; background-color: #f7f7f7; border: solid 1px black }
.p                { color: #4b4646; font-style: normal; font-weight: normal; font-size: 9pt; font-family: Verdana, Arial, Helvetica, Geneva, Swiss, SunSans-Regular; margin-top: 0px; margin-right: 5px; margin-left: 10px }
-->
</style>
<link rel="stylesheet" href="../BPUN.css">
<base target="principal">
<style fprolloverstyle>
A:hover {color: #C0C0C0; font-weight: bold}
.Style10 {font-size: 8pt; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif;}
.Style11 {font-family: Verdana, Arial, Helvetica, sans-serif}
.Style14 {color: #000000; }
</style>
 
<SCRIPT LANGUAGE="JavaScript">
<!--
function check()
{
if (document.forms[0].elements[0].value=='')
{
alert("Veuillez indiquer une adresse email, svp");
return(false);
}
// Un Email ne contient pas de vide
if (document.forms[0].elements[0].value.search(/ /) !='-1')
{
alert("Pas de blanc dans une adresse Mail");
return(false);
}
var s=document.forms[0].elements[0].value.split(/@/);
// s devient un tableau qui est composé par la valeur du champ coupé aux @
if ((s.length !=2) || s[0]=='' || s[1]=='')
{
alert("Format non conventionnel pour un Email");
return(false);
}
if (document.forms[0].elements[1].value=='Sélectionnez une classe cdu')
{
alert("Veuillez saisir une classe CDU, svp");
return(false);
}
if (document.forms[0].elements[2].value=='')
{
alert("Veuillez indiquer un titre, svp");
return(false);
}
if (document.forms[0].elements[4].value=='')
{
alert("Veuillez indiquer un lien, svp");
return(false);
}
return(true);
}
//-->
</SCRIPT>
 
 
</head>
 
<body bgcolor="#FFFFFF" link="#4F7499" background="../nav/bkgmain.gif" alink="#000080">
<table border="0" align="left" cellpadding="0" cellspacing="0" width="600" height="423">
  <tr>
    <td width="599" height="16">
<TABLE height=387 cellSpacing=0 cellPadding=0 width=587 align=left border=0>
  <TR>
    <TD width=31 height=23><font size="2"><IMG src="vide.gif" border=0 width="30" height="20"></font></TD>
    <TD width=556 height=23><font size="2"><IMG src="shim.gif" width="1" height="1"></font></TD></TR>
  <TR>
    <TD width=31 height=36><font size="2">&nbsp;</font></TD>
    <TD width=556 height=36><font size="2"><IMG 
      src="SalleLectVirt.jpg" border=0 width="553" height="44"></font></TD>
  </TR>
  <TR vAlign=top>
    <TD width=31 height=328><font size="2">&nbsp;</font></TD>
    <TD vAlign=top width=556 height=328>
      <DIV align=left>
 
									<table cellspacing=0 cols=4 cellpadding=0 width=556 border=0>
										<tbody>
											<tr>
												<td width=536 style="font-family: Arial Unicode MS">
													<form name="propachat" action="ajout_bd_valid.asp" method="post" onsubmit="return(check());">
														<table width="504" border="0" cellspacing="0" cellpadding="0">
															<tr>
																<td colspan="4">
																	<div align=left>
                                                                        <h3 class="TxtNormal"><strong><br>
                                                                          <br>
                                                                        Proposition d'une nouvelle base de donn&eacute;es </strong><br>
																			<span class=Subnav1>
																		<font color=#000000>
																		<span style="font-weight: 400">(Les champs munis d'un ast&eacute;risque sont obligatoires)</span></font><font size="1" color=#000000><br>
																					<br>
																				</font></span></h3>
																  </div>
																</td>
															</tr>
															<tr>
																<td colspan="4" bgcolor="white">
																	<h4 class="TxtNormal"><strong>Donn&eacute;es personnnelles</strong></h4>
																</td>
															</tr>
															<tr height="5">
																<td valign="top" width="98" height="5"></td>
																<td valign="top" width="7" height="5"></td>
																<td valign="top" width="8" height="5"></td>
																<td valign="top" width="391" height="5"></td>
															</tr>
 
															<tr height="20">
																<td width="98" height="20" valign="top" class="TxtNormal">
																	<div align="right" class="Style14">
																		<span class=Style10><b class=Style10>
																		<font size="2" face="Verdana" class=Style11 style="font-size: 8pt; font-size: 8pt; font-weight: normal;">* Votre email</font></b></span></div>
																</td>
																<td valign="top" width="7" height="20"></td>
																<td valign="top" width="8" height="20"></td>
																<td valign="top" width="391" height="20"><input size=60 name=Email class=TxtNormal></td>
															</tr>
 
															<tr height="5">
																<td width="98" height="5" valign="top" class="TxtNormal Style14"></td>
																<td width="7" height="5"></td>
																<td width="8" height="5"></td>
																<td width="391" height="5"></td>
															</tr>
															<tr>
																<td colspan="4" valign="top" bgcolor="white" class="TxtNormal">
																	<h4 class="TxtNormal Style14"><br>
																		<strong>Donn&eacute;es relatives &agrave; la base de donn&eacute;es </strong></h4>
																</td>
															</tr>
															<tr height="5">
																<td width="98" height="5" valign="top" class="TxtNormal Style14"></td>
																<td valign="top" width="7" height="5"></td>
																<td valign="top" width="8" height="5"></td>
																<td valign="top" width="391" height="5"></td>
															</tr>
															<tr>
        <td width="98" align="right" valign="top" class="TxtNormal Style14"><div align="right">*Section </div></td>
        <td width="7">&nbsp;</td>
		 <td width="8" >&nbsp;</td>
        <td width="391" align="left" valign="top"><select name="Section" class="TxtNormal" id="Section">
 
 
		<%'-------création de la connection et du recordset pour les matières-----------
Set ConnMatieres = Server.CreateObject("ADODB.Connection")
ConnMatieres.Open DSN_BASE
Set RsMatieres = Server.CreateObject("ADODB.Recordset")%>
		<% rsMatieres.Open "Select * from T_matieres ORDER BY cdu" , ConnMatieres
		Do Until RsMatieres.Eof %>
 
		<option value="<%=RsMatieres("matiere")%>"><%=RsMatieres("matiere")%></option>
		<% 
		RsMatieres.MoveNext 
Loop
		RsMatieres.Close
Set RsMatieres = Nothing
ConnMatieres.Close
Set ConnMatieres = Nothing%></select></td>
      </tr>	
 
															<tr height="20">
																<td width="98" height="20" valign="top" class="TxtNormal">
																	<div align="right" class="Style14">
																		<div align="right"><span class=Style10><b class=Style10>
																	    <font size="2" face="Verdana" class=Style11 style="font-size: 8pt; font-size: 8pt; font-weight: normal;">* Titre</font></b></span></div>
																	</div>
																</td>
																<td valign="top" width="7" height="20"></td>
																<td valign="top" width="8" height="20"></td>
																<td valign="top" width="391" height="20"><input size=60 name="Titre" class=TxtNormal></td>
															</tr>
 
															<tr height="20">
																<td width="98" height="20" valign="top" class="TxtNormal">																	<div align="right">Description de la base de donn&eacute;es </div></td>
																<td width="7" height="20" valign="top" class="TxtNormal"></td>
																<td valign="top" width="8" height="20"></td>
																<td valign="top" width="391" height="20"><textarea name="Remarque" class=TxtNormal wrap=virtual cols="60" rows="5"></textarea></td>
															</tr>
															<tr height="20">
																<td width="98" height="20" valign="top" class="TxtNormal">
																	<div align="right" class="Style14">
 
																		<div align="right"><font size="2" face="Verdana" class=TxtNormal >* Lien</font></b></span></div>
																	</div>
																</td>
																<td valign="top" width="7" height="20"></td>
																<td valign="top" width="8" height="20"></td>
																<td valign="top" width="391" height="20"><input name="Lien" class=TxtNormal id="Lien" value="http://" size=60></td>
															</tr>
															<tr height="5">
																<td width="98" height="2"></td>
																<td width="7" height="2"></td>
																<td width="8" height="2"></td>
																<td width="391" height="2"></td>
															</tr>
															<tr height="20">
																<td bgcolor="white" width="98" height="20"></td>
																<td bgcolor="white" width="7" height="20"></td>
																<td bgcolor="white" width="8" height="20"></td>
																<td bgcolor="white" width="391" height="20"></td>
															</tr>
															<tr>
																<td bgcolor="white" width="98"></td>
																<td bgcolor="white" width="7"></td>
																<td bgcolor="white" width="8"></td>
																<td bgcolor="white" width="391">
																	<div align="center">
																		<span class=Subnav1><b class=Subnav1><font size="2" color="#000000"><input type="submit" value="Envoyer" class=button> &nbsp; <input type="reset" value="Tout effacer" class=button> </font></b></span></div>
																</td>
															</tr>
															<tr height="20">
                                                              <td height="20" colspan="4" bgcolor="white" class="TxtNormal"><br>
                                                                <br>
                                                                Votre site sera v&eacute;rifi&eacute; et rendu visible aux visiteurs  s'il est retenu.<BR>
    N'ajoutez pas plusieurs fois le m&ecirc;me site, ceci n'acc&eacute;l&egrave;rera en aucune fa&ccedil;on sa disponibilit&eacute;.</td>
														  </tr>
															<tr>
																<td colspan="4" bgcolor="white">
																	<div align="center">
																  </div>
																</td>
															</tr>
														</table>
												  </form>
												</td>
											</tr>
										</tbody>
									</table>
 
			</DIV></TD></TR></TABLE>
*</td>
    <td width="10" height="16"><img border="0" src="AcqGen5.gif" width="1" height="1"></td>
  </tr>
  <tr valign="top">
				<td height="67">
 </td>
			</tr>
</table>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 13h27   #4
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
Pour le message précédent, il s'agit bien sûr du code qui est dans la bd Access. Le code de la page qui doit l'appeler est:
Code :
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
 
<!--#include file="connexion.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Document sans titre</title>
<link href="bpun_asp.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.Style1 {color: #666600}
-->
</style>
</head>
 
<body>
 
<table width="565"  border="0" align="center" cellpadding="0" cellspacing="0" class="pied_de_page1">
  <tr> 
    <td colspan="2"><img src="img/haut_logo.jpg" width="600" height="27"></td>
  </tr>
  <tr> 
    <td width="239"><img src="img/logo.jpg" width="151" height="81"></td>
    <td width="361" class="en_tete">Bienvenue</td>
  </tr>
  <tr>
    <td height="4" colspan="2"><img src="img/bas_logo.jpg" width="600" height="4"></td>
  </tr>
  <tr> 
    <td colspan="2" class="menu_principal"></td>
  </tr>
 
  <tr> 
    <td colspan="2"><img src="img/haut.jpg" width="600" height="13"></td>
  </tr>
 
  <tr> 
    <td colspan="2" height="330" >
 
	<% Set ConnMenu = Server.CreateObject("ADODB.Connection")
ConnMenu.Open DSN_BASE
Set RsMenu = Server.CreateObject("ADODB.Recordset")%>
<% RsMenu.Open "Select * from T_site where sous_menu1 like 'form_bd' " , ConnMenu %>
<%=RsMenu("texte")%>
 
<%'-------fermeture de la connection et du recordset----------
RsMenu.Close
Set RsMenu = Nothing
ConnMenu.Close
Set ConnMenu = Nothing%>
 
	</td>
  </tr>
  <tr> 
    <td colspan="2"><img src="img/bas.jpg"></td>
  </tr>
  <tr><td height="91" align="left" valign="top"><p class="Style1">3, Place Numa-Droz<br>
        2000 Neuchâtel<br>
        <br>
        Tél. <strong>+41 32 717 73 00</strong><br>
        Fax <strong>+41 32 717 73 09<br>
        <br>
        </strong>Coll&egrave;ge latin, 2e &eacute;tage, cot&eacute; est </p>
      </td> 
    <td align="right" valign="top"><p class="Style1">Heures d'ouverture<br>
        <strong>Lecture publique</strong><br>
    mardi-vendredi: 12h-19h<br>
    samedi: 9h-17h <br>
    <strong>Fonds d'&eacute;tude</strong><br>
      mardi-vendredi: 10h-12h / 14h-19h<br>
      samedi: 9h-12h </p>
    </td>
  </tr>
  <tr> 
    <td colspan="2"><img src="img/bas.jpg"></td>
  </tr>
 
</table>
</body>
</html>
Tout ce qui est html est autre s'affiche. La partie asp reste morte...
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 13h31   #5
Membre régulier
 
Inscription : juillet 2005
Messages : 161
Détails du profil
Informations forums :
Inscription : juillet 2005
Messages : 161
Points : 92
Points : 92
c'est ou exactement que tu recupères le champ qui contient le code ASP
Mateache est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 13h43   #6
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
c'est un champ qui s'appelle texte dans Access, et c'est donc
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 13h45   #7
Membre expérimenté
 
Avatar de Phiss
 
Homme
Développeur Web
Inscription : mai 2005
Messages : 660
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 30
Localisation : France

Informations professionnelles :
Activité : Développeur Web
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : mai 2005
Messages : 660
Points : 581
Points : 581
a la différence du html, l'asp est exécuter du coté du serveur.
Donc si tu fais un response.write avec ton asp le seul truc qui risque de se passer c'est que tu affiches ton code asp sur ton navigateur internet comme du texte simple.
__________________
" L'absence diminue les médiocres passions et augmente les grandes, comme le vent éteint les bougies et allume le feu. "
La Rochefoucauld
Phiss est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 14h34   #8
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
Ok, merci, je n'étais pas conscient de la chose, mais comment y remédier?
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 14h36   #9
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
Pour un bibliothécaire amateur d'informatique tel que moi, des notions telles que côté serveur, ou l'effet exact de Response.write dans toutes ses implications sont un peu touffues et assez hermétiques... Désolé...
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 14h41   #10
Membre expérimenté
 
Avatar de Phiss
 
Homme
Développeur Web
Inscription : mai 2005
Messages : 660
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 30
Localisation : France

Informations professionnelles :
Activité : Développeur Web
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : mai 2005
Messages : 660
Points : 581
Points : 581
dis nous pourquoi tu tiens à mettre du code asp dans une base de donnée?
__________________
" L'absence diminue les médiocres passions et augmente les grandes, comme le vent éteint les bougies et allume le feu. "
La Rochefoucauld
Phiss est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 14h46   #11
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
Pour pouvoir faire ensuite la recherche sur l'ensemble des pages du site qui se trouveront toutes dans le même champ!!!
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 14h54   #12
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
Est-ce si absurde de procéder ainsi???
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 15h36   #13
Membre expérimenté
 
Avatar de Phiss
 
Homme
Développeur Web
Inscription : mai 2005
Messages : 660
Détails du profil
Informations personnelles :
Sexe : Homme
Âge : 30
Localisation : France

Informations professionnelles :
Activité : Développeur Web
Secteur : High Tech - Multimédia et Internet

Informations forums :
Inscription : mai 2005
Messages : 660
Points : 581
Points : 581
personnellement je ne vois pas de solution à ton problème.
Ce serait mieux de trouver une autre solution pour ta recherche plutôt que de faire ça.

L'asp ne sera jamais executé.
__________________
" L'absence diminue les médiocres passions et augmente les grandes, comme le vent éteint les bougies et allume le feu. "
La Rochefoucauld
Phiss est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 21/07/2006, 18h31   #14
Membre éprouvé
 
Inscription : septembre 2004
Messages : 368
Détails du profil
Informations forums :
Inscription : septembre 2004
Messages : 368
Points : 402
Points : 402
Salut,

C'est vrai qu'il faut bien saisir cette notion "coté serveur" pour mieux construire tes scripts.

Un serveur web envoit des page html à un client web. En ajoutant cette notion de page dynamique avec asp ou php, ca permet de créer un "type de page" dont le contenu html envoyé au client pourra etre différent.

Si j'ai bien compris ta problématique, il faut que tu stocke du contenu html dans la base de données et non le code asp.

Ca semble etre un cas de "gestion de contenu". Et en modélisant la base de données de manière adéquate, la recherche sera plus simple
Gwenn est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 25/07/2006, 08h07   #15
Invité régulier
 
Inscription : décembre 2004
Messages : 40
Détails du profil
Informations forums :
Inscription : décembre 2004
Messages : 40
Points : 7
Points : 7
Ok, merci pour vos réponses, et désolé pour mes remerciements tardifs, j'ai dû m'absenter quelques jours.
Bonne journée à tous.
tonyC est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 11h27.


 
 
 
 
Partenaires

Hébergement Web