IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

ASP Discussion :

pb asp avec la recuperation d'une valeur


Sujet :

ASP

  1. #1
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    382
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Nord (Nord Pas de Calais)

    Informations forums :
    Inscription : Mai 2006
    Messages : 382
    Points : 151
    Points
    151
    Par défaut pb asp avec la recuperation d'une valeur
    je realise un panier pour permettre la commande en ligne de certains produits

    voici ma page asp :

    code :
    <code>
    <html>
    <head><title>Le Clone --> Les Moniteurs</title>
    <link rel="stylesheet" type="text/css" href="style.css">
    </head>

    <body>
    <table border="1" cellpadding="0" cellspacing="0" style="border-width:0; border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber1" height="130">
    <tr>
    <td width="100%" height="130" valign="middle" style="border-style: none; border-width: medium">
    <p align="right">
    <img border="0" src="../logo/logo1.gif" align="left" width="193" height="111"></td>
    </tr>
    </table>
    <p align="center"><b><u><font color="#0000FF" size="5">Les moniteurs : </font></u></b></p>
    <%'-------déclaration de la base------------------------------
    DSN_BASE = "DBQ=" & Server.Mappath("webleclone.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};Driverld=25"%>

    <%'-------création de la connection et du recordset-----------
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open DSN_BASE
    Set RS = Server.CreateObject("ADODB.Recordset")%>

    <%'-------définition et exécution de la requête---------------
    RequeteSQL = "SELECT R_materiel.Ref_materiel, R_materiel.Photo_materiel, R_materiel.Nom_materiel, R_materiel.Type_materiel, R_materiel.Marque_materiel, R_materiel.PrixHT_materiel, R_materiel.Dispo_materiel, R_materiel.Acheter_materiel FROM R_materiel WHERE R_materiel.Ref1_leclone Like 'ecran%'"
    RS.Open RequeteSQL , Conn%>
    <%if RS.EOF then %>
    Nous n'avons aucun articles à vous proposer
    <%else%>


    <Table border="1" width="788" align="center" bordercolor="black">
    <TR>
    <TH width="70"><font color="#FF0000">Référence</font></TH>
    <TH width="48"><font color="#FF0000">Produit</font></TH>
    <TH width="203"><font color="#FF0000">Nom</font></TH>
    <TH width="37"><font color="#FF0000">Type</font></TH>
    <TH width="54"><font color="#FF0000">Marque</font></TH>
    <TH width="193"><font color="#FF0000">PrixHT</font></TH>
    <TH width="86"><font color="#FF0000">Disponibilité</font></TH>
    <TH width="72"><font color="#FF0000">Acheter</font></TH>
    </TR>



    <%Do While Not RS.EOF%>


    <TR>
    <TD width="70"><font color="#000000"><%=RS("Ref_materiel")%></font> &nbsp;</TD>
    <TD width="48"><font color="#000000"><%=RS("Photo_materiel")%></font> &nbsp;</TD>
    <TD width="203"><font color="#000000"><%=RS("Nom_materiel")%></font> &nbsp;</TD>
    <TD width="37"><font color="#000000"><%=RS("Type_materiel")%></font>&nbsp;</TD>
    <TD width="54"><font color="#000000"><%=RS("Marque_materiel")%></font>&nbsp;</TD>
    <TD width="193"><font color="#000000"><%=RS("PrixHT_materiel")%> €</font>&nbsp;</TD>
    <TD width="86"><font color="#000000"><%=RS("Dispo_materiel")%></font>&nbsp;</TD>
    <TD width="72"><font color="#000000"><a href="commander.asp?ref=<%=RS("Ref_materiel")%>"><%=RS("Acheter_materiel")%></a></font>&nbsp;</TD> </TR>
    <%RS.MoveNext%>
    <%Loop %>
    </table>


    <%end if%>




    <%'-------fermeture de la connection et du recordset----------
    </code>

    et apparament la ligne en rouge pose pb car ce lien va ver commander.asp
    et il me met ca comme erreur :

    Erreur d'exécution Microsoft VBScript error '800a000d'

    Type incompatible: 'QueryString'

    /stage/pages/commander.asp, line 18

    je n'arrive pas a resoudre ce pb
    pouvez-vous m'aider?????
    merci d'avance
    Développeur LotusScript

  2. #2
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    168
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 168
    Points : 196
    Points
    196
    Par défaut
    Salut es tu sur d avoir des donnee dans ton recordset RS ? Sinon RS est a null et du coup ta querystring est foutue...++
    Sur terre il y a 10 types de personnes, celles qui comprennent le binaire et les autres...

  3. #3
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    382
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Nord (Nord Pas de Calais)

    Informations forums :
    Inscription : Mai 2006
    Messages : 382
    Points : 151
    Points
    151
    Par défaut
    oui j'en suis sur

    qd je clic sur le lien commander, dans la barre d'adresse en haut, il y a une valeur pr ref_materiel

    c'est bizarre, je ne comprend pas du tout cette erreur
    Développeur LotusScript

  4. #4
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    168
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 168
    Points : 196
    Points
    196
    Par défaut
    C est dans ta page commander.asp qu il y a une erreur, est ce celle que tu nous presente dans ton extrait de code ? sinon montre nous commander.asp
    Sur terre il y a 10 types de personnes, celles qui comprennent le binaire et les autres...

  5. #5
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    382
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Nord (Nord Pas de Calais)

    Informations forums :
    Inscription : Mai 2006
    Messages : 382
    Points : 151
    Points
    151
    Par défaut
    voici ma page commander.asp :

    <code>
    <% REF=QueryString ("ref")%>

    <%'-------déclaration de la base------------------------------
    DSN_BASE = "DBQ=" & Server.Mappath("webleclone.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};Driverld=25"%>

    <%'-------création de la connection et du recordset-----------
    Set Conn = Server.CreateObject("ADODB.Connection")
    Conn.Open DSN_BASE
    Set RS = Server.CreateObject("ADODB.Recordset")%>

    <%'-------définition et exécution de la requête---------------
    RequeteSQL = "SELECT R_materiel.Ref_materiel, R_materiel.Nom_materiel, R_materiel.PrixHT_materiel FROM R_materiel WHERE R_materiel.Ref_materiel = & REF "
    RS.Open RequeteSQL , Conn%>
    <%if RS.EOF then %>
    Cette article ne se trouve plus dans la base de données. Essayez un autre article !!
    <%else%>


    <Table border="1" width="810" align="center" bordercolor="black">
    <TR>
    <TH width="70"><font color="#FF0000">Référence</font></TH>

    <TH width="239"><font color="#FF0000">Article</font></TH>

    <TH width="179"><font color="#FF0000">Prix Unitaire HT</font></TH>
    </TR>



    <%Do While Not RS.EOF%>

    <TR>
    <TD width="70"><font color="#000000"><%=RS("Ref_materiel")%></font> &nbsp;</TD>
    <TD width="239"><font color="#000000"><%=RS("Nom_materiel")%></font> &nbsp;</TD>
    <TD width="179"><font color="#000000"><%=RS("PrixHT_materiel")%> €</font>&nbsp;</TD>

    </TR>
    <%RS.MoveNext%>
    <%Loop %>
    </table>


    <%end if%>

    </code>

    merci d'avance de votre reflexion sur ce pb
    Développeur LotusScript

  6. #6
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    168
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2006
    Messages : 168
    Points : 196
    Points
    196
    Par défaut
    Essaye avec
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <% REF=request.QueryString ("ref")%>
    Sur terre il y a 10 types de personnes, celles qui comprennent le binaire et les autres...

  7. #7
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    382
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Nord (Nord Pas de Calais)

    Informations forums :
    Inscription : Mai 2006
    Messages : 382
    Points : 151
    Points
    151
    Par défaut
    je l'ai fé

    c en haut de la page commander.asp

    il me dit type incompatible : "queryString"
    Développeur LotusScript

  8. #8
    Membre habitué
    Profil pro
    Inscrit en
    Mai 2006
    Messages
    382
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Nord (Nord Pas de Calais)

    Informations forums :
    Inscription : Mai 2006
    Messages : 382
    Points : 151
    Points
    151
    Par défaut
    c bon g trouver
    g oublier de mettre le request avec le querystring


    Merci à fablondon pr ces messages
    Développeur LotusScript

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 2
    Dernier message: 02/02/2012, 16h19
  2. Recuperation d'une valeur avec ADO
    Par MuadDib_II dans le forum VBA Access
    Réponses: 3
    Dernier message: 21/07/2008, 11h49
  3. Probleme recuperation d'une valeur : script vbs -> .bat
    Par pinpin_du_net dans le forum Windows
    Réponses: 3
    Dernier message: 10/05/2005, 12h43
  4. [C#] Recuperation d'une valeur DropDownList
    Par topolino dans le forum ASP.NET
    Réponses: 4
    Dernier message: 10/03/2005, 16h33
  5. Réponses: 4
    Dernier message: 01/09/2004, 16h56

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo