begin process at 2012 05 27 13:24:15
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive ASP & ASP.NET

 > 

Archives ASP & ASP.NET

 > 

Débutants

 > 

Affichage sans résultat


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

Affichage sans résultat

vendredi 21 octobre 2005 à 19:24:24 | Affichage sans résultat

blangenois

Bonsoir,
lorsque j'affiche une page asp sans résultat, j'aimerai afficher un message du type
" Votre recherche n'a donnée aucun résultat "
Comment puis je faire, pour l'instant c'est 

ADODB.Field error '800a0bcd'

BOF ou EOF est égal à True ou l'enregistrement actuel a été supprimé. L'opération demandée nécessite un enregistrement actuel
et ce n'est pas du plus bel effet....
Merci d'avance et bonne soirée.

Philippe

vendredi 21 octobre 2005 à 20:13:45 | Re : Affichage sans résultat

Nurgle

Membre Club Administrateur CodeS-SourceS
Salut,

Une truc comme ça devrait suffire :

If Not RecordSet.EOF Then
' ici tout ton traitement sur les résultats

Else
Response.Write("Votre recherche n'a donnée aucun résultat")
End If


Mais il faudrait que tu nous montre un bout de ton code pour savoir où l'insérer exactement


Nurgle

Il est plus aisé d'être sage pour les autres que pour soi-même ! (La Rochefoucauld)
dimanche 23 octobre 2005 à 19:02:12 | Re : Affichage sans résultat

blangenois

Puis je le poster sur le news.....????....

Philippe
lundi 24 octobre 2005 à 09:29:11 | Re : Affichage sans résultat

Nurgle

Membre Club Administrateur CodeS-SourceS
les news ? quelles news ?

(moi pas comprendre ; je dois pas être bien réveillé ce matin )


Nurgle

Il est plus aisé d'être sage pour les autres que pour soi-même ! (La Rochefoucauld)
lundi 24 octobre 2005 à 17:57:24 | Re : Affichage sans résultat

blangenois

Le forum........

Puis je poster ma page.....

Philippe
lundi 24 octobre 2005 à 18:08:26 | Re : Affichage sans résultat

Nurgle

Membre Club Administrateur CodeS-SourceS
ah oui, bien sûr !




lundi 24 octobre 2005 à 19:26:10 | Re : Affichage sans résultat

blangenois

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="../Connections/CisQuery.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.Form("Cherche_Nsn") <> "") Then
  Recordset1__MMColParam = Request.Form("Cherche_Nsn")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_CisQuery_STRING
Recordset1.Source = "SELECT * FROM AspRechercheNsn WHERE Expr1 LIKE '%" + Replace(Recordset1__MMColParam, "'", "''") + "%' ORDER BY NSN ASC"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

Dim Recordset1_total
Dim Recordset1_first
Dim Recordset1_last

' set the record count
Recordset1_total = Recordset1.RecordCount

' set the number of rows displayed on this page
If (Recordset1_numRows < 0) Then
  Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
  Recordset1_numRows = 1
End If

' set the first and last displayed record
Recordset1_first = 1
Recordset1_last  = Recordset1_first + Recordset1_numRows - 1

' if we have the correct record count, check the other stats
If (Recordset1_total <> -1) Then
  If (Recordset1_first > Recordset1_total) Then
    Recordset1_first = Recordset1_total
  End If
  If (Recordset1_last > Recordset1_total) Then
    Recordset1_last = Recordset1_total
  End If
  If (Recordset1_numRows > Recordset1_total) Then
    Recordset1_numRows = Recordset1_total
  End If
End If
%>
<%
' *** Recordset Stats: if we don't know the record count, manually count them

If (Recordset1_total = -1) Then

  ' count the total records by iterating through the recordset
  Recordset1_total=0
  While (Not Recordset1.EOF)
    Recordset1_total = Recordset1_total + 1
    Recordset1.MoveNext
  Wend

  ' reset the cursor to the beginning
  If (Recordset1.CursorType > 0) Then
    Recordset1.MoveFirst
  Else
    Recordset1.Requery
  End If

  ' set the number of rows displayed on this page
  If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then
    Recordset1_numRows = Recordset1_total
  End If

  ' set the first and last displayed record
  Recordset1_first = 1
  Recordset1_last = Recordset1_first + Recordset1_numRows - 1
 
  If (Recordset1_first > Recordset1_total) Then
    Recordset1_first = Recordset1_total
  End If
  If (Recordset1_last > Recordset1_total) Then
    Recordset1_last = Recordset1_total
  End If

End If
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
  MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
  MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "")  Then
  MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
  MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<html>
<head>
<title>Resultat recherche NSN</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
a:link {
 color: #BE7E3F;
}
a:visited {
 color: #BE7E3F;
}
a:hover {
 color: #FF6600;
}
a:active {
 color: #BE7E3F;
}
.Style7 {color: #BE7E3F; font-style: italic; }
.Style10 {
 color: #BF8B5D;
 font-weight: bold;
}
.Style14 {font-size: 13px; font-weight: bold; color: #663333; }
.Style19 {
 font-size: 14px;
 font-weight: bold;
}
.Style21 {
 color: #BE7E3F;
 font-weight: bold;
 font-style: italic;
}
.Style22 {
 color: #666633;
 font-weight: bold;
}
.Style25 {color: #666633}
.Style27 {
 color: #F8EEC7;
 font-weight: bold;
}
.Style30 {
 color: #660000;
 font-weight: bold;
}
body {
 background-color: #E6D8B9;
}
-->
</style>
</head>

<body>
<table width="80%" border="0" align="center"><!--DWLayoutTable-->
  <tr>
    <td width="626" height="21"><div align="center">
      <p align="center"><font color="#CC6600"><em>Il y a <strong><%=(Recordset1_total)%></strong> enregistrement(s) pour </em></font>
        <% =Request.Form("Cherche_Nsn") %>
- <a href="http://iliassrv000.idcn.mil.intra/IIF/Report/CIDMAT/NSN.asp?NSN=<% =Request.Form("Cherche_Nsn") %>" target="_blank">SPART</a>  - <a href="?NSN=<% =Request.Form("Cherche_Nsn") %>" target="_blank">STOCK</a> <BR>
      </p>
    </div></td>
  </tr>
</table>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
  <%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
  <tr bgcolor="#FFCC66">
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr bgcolor="#CC9966">
    <td colspan="3">&nbsp;</td>
  </tr>
  <tr>
    <td colspan="3" bgcolor="#F8EEC7"><table width="204" height="28" border="0" align="right" cellpadding="0" cellspacing="0">
        <tr>
          <td><div align="center" class="Style22">PN : <%=(Recordset1.Fields.Item("PN").Value)%></div></td>
        </tr>
              </table>        <table width="367" border="0" align="left" cellpadding="0" cellspacing="0">
                <tr>
                 
          <td height="34" valign="top"><strong><a href="http://iliassrv000.idcn.mil.intra/IIF/Report/CIDMAT/NSN.asp?NSN=<%=(Recordset1.Fields.Item("NSNIlias").Value)%>" target="_blank"><%=(Recordset1.Fields.Item("SelectNSN").Value)%></a></strong></td>
                </tr>
              </table></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top" bgcolor="#F8EEC7"><span class="Style19"><font face="Verdana, Arial, Helvetica, sans-serif"><%=(Recordset1.Fields.Item("DENOM").Value)%></font></span></td>
    <td width="249" rowspan="6" bgcolor="#F8EEC7"><div align="center">
      <p><strong><img src="../Img_dynam/PhotoNsn/<%=(Recordset1.Fields.Item("CheminImage").Value)%>" onerror="this.src='../Img_dynam/photoNsn/nophoto.jpg';" width="79" height="66" align="top"></strong></p>
      <p><a href="../Img_dynam/PhotoNsn/<%=(Recordset1.Fields.Item("CheminImage").Value)%>" target="_blank">Zoom</a></p>
    </div></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top" bgcolor="#F8EEC7"><div align="left"></div></td>
  </tr>
  <tr>
    <td align="left" valign="top" bgcolor="#F8EEC7"><div align="left"><strong><span class="Style25"><span class="Style21"><%=(Recordset1.Fields.Item("UM").Value)%></span></span> </strong></div></td>
    <td align="left" valign="top" bgcolor="#F8EEC7"><div align="right"><strong><span class="Style25"><strong><%=(Recordset1.Fields.Item("Compt").Value)%> - <%=(Recordset1.Fields.Item("LOCAL").Value)%></strong></span></strong></div></td>
  </tr>
  <tr>
    <td width="249" align="left" valign="top" bgcolor="#F8EEC7"><strong><span class="Style7"><%=(Recordset1.Fields.Item("CDMAT").Value)%></span></strong></td>
    <td width="108" align="left" valign="top" bgcolor="#F8EEC7"><span class="Style14"><%=(Recordset1.Fields.Item("PRIX").Value)%> &euro;</span></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top" bgcolor="#F8EEC7"><span class="Style10"><%=(Recordset1.Fields.Item("SelectStock").Value)%></span></td>
  </tr>
  <tr>
    <td colspan="2" align="left" valign="top" bgcolor="#F8EEC7"><span class="Style30"><a href="<%=(Recordset1.Fields.Item("test").Value)%>" target="_blank">Stock ILIAS</a>&nbsp;<a href="<%=(Recordset1.Fields.Item("RPLOANI4").Value)%>" target="_blank"><a href="<%=(Recordset1.Fields.Item("RPLOANI4").Value)%>" target="_blank"><%=(Recordset1.Fields.Item("Loan4").Value)%></a>&nbsp;<a href="<%=(Recordset1.Fields.Item("RPLOANI5").Value)%>" target="_blank" class="Style30"><%=(Recordset1.Fields.Item("Loan5").Value)%></a> </span></td>
  </tr>
  <tr bgcolor="#CC9966">
    <td colspan="3"><table width="250" border="0" align="right" cellspacing="0">
          <tr>
            <td width="110"><table width="71" border="0" align="right" cellspacing="0">
                <tr>
                  <td width="69"><div align="center"><a href="InsertionFavoris.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "NSN=" & Recordset1.Fields.Item("NSN").Value %>" target="wclose"
onClick="window.open('InsertionFavoris.asp','wclose',
'width=650,height=350,toolbar=no,scrollbars=no,status=no,left=20,top=50')"><img src="../images/dossier4.jpg" alt="Ajouter à mes Favoris" width="29" height="23" border="0"></a></div></td>
                </tr>
            </table></td>
            <td width="136"><table width="34" border="0" align="right" cellspacing="0">
                <tr>
                  <td><div align="center"><a href="CommandeCaddie.asp?<%= Server.HTMLEncode(MM_keepURL) & MM_joinChar(MM_keepURL) & "NSN=" & Recordset1.Fields.Item("NSN").Value %>" target="wclose"
onClick="window.open('CommandeCaddie.asp','wclose',
'width=700,height=350,toolbar=no,scrollbars=no,status=no,left=20,top=50')"><img src="../images/buyl1.gif" alt="Commander cet article" width="23" height="21" border="0"></a></div></td>
                </tr>
              </table>
                <table width="34" border="0" align="right" cellspacing="0">
                  <tr>
                    <td><div align="center"><a href="<%=(Recordset1.Fields.Item("Gestion").Value)%>" target="_blank" class="Style27">Gestion</a></div></td>
                  </tr>
                </table>
                <table width="34" border="0" align="right" cellspacing="0">
                  <tr>
                    <td><div align="center"></div></td>
                  </tr>
                </table>
                <table width="34" border="0" align="right" cellspacing="0">
                  <tr>
                    <td><div align="center"></div></td>
                  </tr>
              </table></td>
          </tr>
    </table></td></tr>
  <tr bgcolor="#FFCC66">
    <td colspan="3"><a href="Asset.asp?nsn=<%=(Recordset1.Fields.Item("NSN").Value)%>" target="_blank">ASSET</a></td>
  </tr>
  <tr>
    <td colspan="3">&nbsp;</td>
  </tr>
  <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Recordset1.MoveNext()
Wend
%>

</table>

<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>

lundi 24 octobre 2005 à 19:53:03 | Re : Affichage sans résultat

Nurgle

Membre Club Administrateur CodeS-SourceS
si tu pouvais juste spécifier la ligne où il y a l'erreur, ce serait parfait !


Nurgle



Cette discussion est classée dans : enregistrement, résultat, affichage


Répondre à ce message

Sujets en rapport avec ce message

nombre d'enregistrement [ par samoht ] Bonjour,Je fais une requête SQL à partir d'une page ASP, du genre :Select * from Matable where nom = 'tony'S'il y a plus de 454 enregistrments comme r Affichage des champs du RadioButtonList [ par dork_maule ] Bonsoir a tous.J'ai un petit probléme au sujet de mon radiobuttonlist.J'utilise le C# pour le charger et l'ASP pour afficher le résultat mais je n'arr Affichage à partir du dernier enregistrement sous access [ par madoman ] SALUT. Je développe en ASP sous dreamweaver et je souhaite afficher mes données à partir du dernier enregistrement de ma table (ie à partir du dernier Limiter l'affichage d'un résultat de select... [ par Goofeuh ] Bonjour à tous, et oui, je viens encore vous embeter avec mes questions...comme dirait Denisot, "désolé"Alors voila, je fait une recherche dans une bd Affichage d'un résultat couper de moitier [ par Doom ] DoomJe ne comprends pas pourquoi, mais lorsque j'essai d'afficher un champ qui se trouve dans mon recordset, environ la moitier du résultat est affich récupération de données et affichage dans un label [ par julien67 ] salut à tous !J'aurais aimé savoir quelle était la meilleure méthode pour afficher le résultat d'une requête dans un Label de WebForm par exemple...J' SQL séléction au hasard d'un enregistrement d'une table access [ par txR_ch ] Salut,je cherche déséspérement la requête SQL pour access qui séléctionne un enregistrement (ou une ligne) au hasardJe sais que c'est possible pour my affichage du nom du jour [ par chrys76 ] CHRYStout est dans le titreje voudrais que la date s'affiche avec en plus le jourexemple: jeudi 20/11/03je n'ai que la datehelp!!!merci d'avance Récupérer l'ID, Ajout d'un enregistrement dans Access. [ par lmu ] Hello,J'ai une base de donnée Access que j'alimente avec un formulaire ASPX.Quand l'enregistrement est ajouté, j'ai besoin de récupérer l'ID (clé prim Valider l'enregistrement de "blancs" dans un champs de saisie [ par kozher20 ] Bonjour à tousVoilà j'ai créé un formulaire d'insertion dans une base de données avec l'assistant de Dreamweaver MX mais je viens de remarquer que dan


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,357 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales