Salut,
je suis en train de developper un forum et j'ai un bug qui apparait de tps en tps, en faites, c quand je rajoute un message a un endroit precis de l'arboresence des reponses.
Mais ce n'est pas parceque le niveau est trop grand, en faites, voila :
Message principal
->Reponse
--->Re Reponse
----->Re Re Reponse
------->Re Re Re Reponse
----->
Re Re Reponse--->Re Reponse
C'est le message en rouge qui fait bugger, il ne trouve pas l'IDParent dans mes tableau (cf code ci joint) a la ligne 38
Voici le message d'erreur :
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][Pilote ODBC Microsoft Access] Erreur de syntaxe (opérateur absent) dans l'expression 'Groupe=1 And IDParent='.
/clubinfo/dialogue/forum/groupe.asp, line 38
Donc si quelqu'un a une idee, je sais que ce n'est pas facile de trouver une erreur dans un code que l'on a pas ecrit sois même, mais si vous etes motive, posez moi des question, et si il faut, mon email est
ondex@caramail.comAllez, passons au chose serieuse, ce sont 2 fonction appeller part la page, Groupe correspond a la file (ou au groupe) de reponse au quel appartienne les reponse
IDParent corresponse a l'ID (N° Auto dans Acces) du message au quel celui en court repond
Good Luck (bonne chance) :
Dim LevelT() Dim IDT() Redim Preserve LevelT(0) Redim Preserve IDT(0) Level=1 Ligne=0
Function MiseEnFormeGroupe(Groupe, IDActuel) RangeMessage(Groupe) If Ubound(IDT) = 0 Then GroupeTexte = "" Exit Function End If GroupeTexte = "<table width=99% bgcolor=#ffffff border=1 bordercolor=#000000 cellspacing=0><tr><td><font face=Verdana size=2><b><u>Groupe entier :</u></font></b><br><font size=1 face=Verdana>" For A=0 To Ubound(IDT) SQLQuery = "SELECT * From Forum Where Groupe="& Groupe &" And ID="& IDT(A) Set RS1=Base.Execute(SQLQuery) If IDT(A) = IDActuel Then GroupeTexte = GroupeTexte & "<img src=/clubinfo/images/pixel.gif height=1 width=20><img src=/clubinfo/images/pixel.gif height=1 width="& 16*LevelT(A) &"><img src=/clubinfo/images/forum/reponse.gif width=16 height=16 border=0 align=top> <font color=red size=2 face=Verdana><b>"& RS1("Sujet") &"</b> de "& RS1("Auteur") &"</font><br>" Else GroupeTexte = GroupeTexte & "<img src=/clubinfo/images/pixel.gif height=1 width=20><img src=/clubinfo/images/pixel.gif height=1 width="& 16*LevelT(A) &"><a href=javascript:sendform("& RS1("ID") &")><img src=/clubinfo/images/forum/reponse.gif width=16 height=16 border=0 align=top> <b>"& RS1("Sujet") &"</b></a> <i>de "& RS1("Auteur") &" ("& RS1("RealDate") &")</i><br>" End If Next GroupeTexte = GroupeTexte & "</font></td></tr></table>" MiseEnFormeGroupe = GroupeTexte End Function
Function RangeMessage(Groupe) SQLQuery = "SELECT * FROM Forum Where Groupe="& Groupe &" And IDParent=0 Order By RealDate ASC" Set RS1=Base.Execute(SQLQuery) If RS1.EOF Then Exit Function LevelT(0) = Level IDT(0) = RS1("ID") Do Level = LevelT(Ligne)+1 SQLQuery = "SELECT * FROM Forum Where Groupe="& Groupe &" And IDParent="& IDT(Ligne) &" Order By RealDate ASC" Set RS1=Base.Execute(SQLQuery) If Not RS1.EOF Then TmpTablo=RS1.GetRows NewSize = Ubound(IDT) + Ubound(TmpTablo,2) + 1 Redim Preserve LevelT(NewSize) Redim Preserve IDT(NewSize) For A=NewSize To Ligne+1 Step -1 LevelT(A) = LevelT(A-1) IDT(A) = IDT(A-1) Next RS1.MoveFirst LigneTmp = Ligne+1 Do While Not RS1.EOF LevelT(LigneTmp) = Level IDT(LigneTmp) = RS1("ID") LigneTmp=LigneTmp+1 RS1.MoveNext Loop End If Ligne=Ligne+1 Loop Until Ligne-1 = Ubound(IDT) End Function
|