Re: Test requete

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Hans Kesting (news.2.hansdk_at_spamgourmet.com)
Date: 12/07/04


Date: Tue, 7 Dec 2004 13:26:11 +0100

Mickael Jouvin wrote:
> Hello,
>
> I have a problem with my test of requete (if rsTbl("Nom_produit") =
> null then %>
> <option value="1"> "Aucune réponse ne correspond à la requete"
> </option>) and i don' know why ?
>

It's probably not "null" but DbNull.Value.
If that is not the reason of your "problems", please specify (compile error,
runtime error, unexpected behaviour, ...)

> <select name="Nom_produit"
> STYLE="Width:300;font-family:Arial;font-size:10"> <% SET dbConn =
> Server.CreateObject("ADODB.Connection") 'Création de l'objet serveur
> MdbFilePath = Server.MapPath("Latorre.mdb") 'Connexion à la base de
> données mabase.mdb
> dbConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" &
> MdbFilePath & ";"
> SQL="SELECT Document.Nom_produit, Document.ID_produit FROM Document
> WHERE ID_fournisseur= " & request("Nom_fournisseur") & " AND
> ID_gamme= " & request("Nom_gamme") & " order by Nom_produit;"
> SET rsTbl = dbConn.Execute(SQL) %>
> <% DO WHILE not rsTbl.eof
> if rsTbl("Nom_produit") = null then %>
> <option value="1"> "Aucune réponse ne correspond à la requete"
> </option> <%else%>
> <option
> value="<%=rsTbl("ID_produit")%>"><%=rsTbl("Nom_produit")%></option>
> <% End if %> <% rsTbl.movenext
> LOOP
> SET rsTbl=nothing
> dbConn.close
> SET dbConn=nothing %>
> </select>
>
> Regards,
> Mikel



Relevant Pages

  • Re: Required field based on two conditions
    ... I used Select Case because it seemd more concise to me, given that we are dealing with cases -- possible values of the Reason control. ... If AwardTo is a control on the form and is capable of receiving the focus, I don't see why you would get a compile error there. ... Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.formscoding)
  • Re: PVOIID paramter in CreateTimerQueueTimer
    ... That gets rid of the compile error, ... other reason I could not retrieve the correct integer value was that I ...
    (microsoft.public.vc.mfc)
  • Re: Outlook Macro to get Exchange Info from Mail
    ... and for some reason its ... not posting. ... Compile error: ... Set CdoSession = CreateObject ...
    (microsoft.public.outlook.program_vba)
  • Re: Force wdPrintDocumentWithMarkup
    ... A macro like this should work in either version, ... The reason that code won't work in Word 2000 (at least it doesn't work ... for me) is because wdPrintDocumentWithMarkup looks like an undefined ... so I get the "Compile Error: ...
    (microsoft.public.word.vba.general)
  • USE Statement
    ... I would like to the specify the USE argument dynamically as for example: ... the scalar is not recognized (compile error). ... I'm a new forum user. ...
    (perl.dbi.users)