Re: Test requete
From: Hans Kesting (news.2.hansdk_at_spamgourmet.com)
Date: 12/07/04
- Next message: Eliyahu Goldin: "Re: JScript - handling OK/Cancel in confirmation box"
- Previous message: Tampa .NET Koder: "RE: ImageUrlEditor"
- In reply to: Mickael Jouvin: "Test requete"
- Next in thread: Tampa .NET Koder: "RE: Test requete"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Eliyahu Goldin: "Re: JScript - handling OK/Cancel in confirmation box"
- Previous message: Tampa .NET Koder: "RE: ImageUrlEditor"
- In reply to: Mickael Jouvin: "Test requete"
- Next in thread: Tampa .NET Koder: "RE: Test requete"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|