Problème dans mon code

NeoDarklink Messages postés 7 Date d'inscription mercredi 30 juillet 2008 Statut Membre Dernière intervention 12 décembre 2008 - 10 oct. 2008 à 14:13
NeoDarklink Messages postés 7 Date d'inscription mercredi 30 juillet 2008 Statut Membre Dernière intervention 12 décembre 2008 - 27 nov. 2008 à 09:49
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CY1410680%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->
Bonjour à vous.



 




Je viens à vous car j’ai un petit problème de codage ASP.



 




Lorsque je mets ce qui est en commentaire (la condition)
dans le code, la variable « RS("description_dem") » ne s’affiche
plus sur ma page, alors que tout va bien lorsqu’elle reste en commentaire.



 




Savez-vous pourquoi ?







<%



Do While Not RS.EOF

    Response.write "<tr "
'    If RS("statut_dem") = "1" Then
'    Response.write "class=""ok"""
'    Else
'    Response.write "class=""encour"""
'    End If
    Response.write "><td>[ "& RS("id_dem") &"]</td>"
    Response.write "<td>[ "& RS("description_dem") &"]</td>"
    Response.write "<td>"& RS("date_dem") &"</td></tr>"
    RS.MoveNext
Loop
%>

5 réponses

nhervagault Messages postés 6063 Date d'inscription dimanche 13 avril 2003 Statut Membre Dernière intervention 15 juillet 2011 37
10 oct. 2008 à 22:10
Salut

Tu n'aurais pas un RS("statut_dem") a null ou une erreur dans la syntaxe de ta colonne

Je ne sais plus comment son gerer les colonne null en ASP3
0
cs_ghuysmans99 Messages postés 3982 Date d'inscription jeudi 14 juillet 2005 Statut Membre Dernière intervention 30 juin 2013 16
11 oct. 2008 à 07:43
Dim f 'As String
While Not(rs.EOF)
 Response.write "<tr "
'If RS("statut_dem") = "1" Then
' Response.write "class=""ok"""
' Else
'  Response.write "class=""encour"""
'End If
 Response.write "><td>[ "& RS("id_dem") &"]</td>"
 f = rs("description_dem")
 If Not(IsNull(f)) Then
  %>
 <td>[demande.asp?demande=<%=RS( "><%=f%>]</td>
  <%
 End If
 Response.write "<td>"& RS("date_dem") &"</td></tr>"
 RS.MoveNext
Wend 'Not(rs.EOF)
rs.Close
Set rs = Nothing
'End Sub
0
NeoDarklink Messages postés 7 Date d'inscription mercredi 30 juillet 2008 Statut Membre Dernière intervention 12 décembre 2008
11 oct. 2008 à 15:33
Merci pour vos réponses.

La colonne « RS("statut_dem") » n’est pas null non.

Pour ce qui est du reste, n’ayant pas les sources avec moi pour le moment, je ne peux malheureusement pas tester. Mais je vous tiendrais au courant lorsque cela sera fait.
0
NeoDarklink Messages postés 7 Date d'inscription mercredi 30 juillet 2008 Statut Membre Dernière intervention 12 décembre 2008
26 nov. 2008 à 12:23
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CY1410680%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->
J’ai essayé la méthode de ghuysmans99 mais ca ne fonctionne
toujours pas.



 




Cependant, en plus de ca (ce qui est peut-être lié) certain
champ ne s’affichent plus.


En effet, au lieu d’une date sous la forme standard, j’ai
opté pour une espèce de timestamp plus facilement manipulable. Dans ma base de données,
le champ « date » à donc été remplacé par un « bigint ». Depuis,
ce « timestamp » (qui correspond à la variable « RS("date_dem") »)
ne veut pas s’afficher.



 




Avez-vous une idée du problème ?
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
NeoDarklink Messages postés 7 Date d'inscription mercredi 30 juillet 2008 Statut Membre Dernière intervention 12 décembre 2008
27 nov. 2008 à 09:49
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="ProgId" content="Word.Document" />
<meta name="Generator" content="Microsoft Word 11" />
<meta name="Originator" content="Microsoft Word 11" />
<link rel="File-List" href="file:///C:%5CDOCUME%7E1%5CY1410680%5CLOCALS%7E1%5CTemp%5Cmsohtml1%5C01%5Cclip_filelist.xml" />
<!--[if gte mso 9]><xml>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:HyphenationZone>21</w:HyphenationZone>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
</w:WordDocument>
</xml><![endif]-->
<!--[if gte mso 9]><xml>
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
</w:LatentStyles>
</xml><![endif]-->
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:12.0pt;
font-family:"Times New Roman";
mso-fareast-font-family:"Times New Roman";}
@page Section1
{size:595.3pt 841.9pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Tableau Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
</style>
<![endif]-->
En faite je viens de trouver la solution à mon problème



 




Dans ma base de données, le champ « date » était avant
les autres champs, et lors de l’affichage de ma requête, je ne l’affichais pas
dans le même ordre. Du coup, il ne voulait pas afficher ma date (pareil pour
mon champ qui disparaissait).



 




Pour remédier a cela, j’ai donc créé des variables juste après
ma requête.



 




Pour info, ce problème d’ordre d’affichage d’une requête
est-il normale en ASP ou cela vient de chez moi ?
0
Rejoignez-nous