Test requete

M

Mickael Jouvin

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 ?

<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
 
H

Hans Kesting

Mickael said:
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, ...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top