Avatar billede gummisko Nybegynder
28. august 2005 - 19:35 Der er 2 kommentarer og
1 løsning

Fejl ved søgning med 0 poster som resultat

Hej guruer
Har et træls problem. Når jeg fyrer en form af som napper den nedenstående kode, går det fint, hvis søgningen finder en post.
MEN hvis søgningen ingen poster finder får jeg en fejlmelding:

Fejltype:
ADODB.Recordset (0x800A0BCD)
Enten er BOF eller EOF sand, eller den aktuelle post er blevet slettet. Den anmodede handling kræver en aktuel post.
/wwweamv/firma/sogfelter_result.asp, line 148

Her er koden:

<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="../Connections/firma.asp" -->
<%
Dim Recordset1__a
Recordset1__a = "z"
if (Request("checkbox1")      <> "") then Recordset1__a = Request("checkbox1")     
%>
<%
Dim Recordset1__c
Recordset1__c = "z"
if (Request("checkbox2")      <> "") then Recordset1__c = Request("checkbox2")   
%>
<%
Dim Recordset1__d
Recordset1__d = "z"
if (Request("checkbox3")        <> "") then Recordset1__d = Request("checkbox3")       
%>
<%
Dim Recordset1__e
Recordset1__e = "z"
if (Request("checkbox4")    <> "") then Recordset1__e = Request("checkbox4") 
%>
<%
Dim Recordset1__f
Recordset1__f = "z"
if (Request("checkbox5")    <> "") then Recordset1__f = Request("checkbox5") 
%>
<%
Dim Recordset1__g
Recordset1__g = "z"
if (Request("checkbox6")    <> "") then Recordset1__g = Request("checkbox6") 
%>
<%
Dim Recordset1__h
Recordset1__h = "z"
if (Request("checkbox7")    <> "") then Recordset1__h = Request("checkbox7") 
%>
<%
Dim Recordset1__i
Recordset1__i = "z"
if (Request("checkbox8") <> "") then Recordset1__i = Request("checkbox8")
%>
<%
Dim Recordset1__ge_1
Recordset1__ge_1 = "z"
if (Request("navn") <> "") then Recordset1__ge_1 = Request("navn")
%>
<%
Dim Recordset1__fi_1
Recordset1__fi_1 = "z"
if (Request("adresse") <> "") then Recordset1__fi_1 = Request("adresse")
%>
<%
Dim Recordset1__oa_1
Recordset1__oa_1 = "z"
if (Request("email") <> "") then Recordset1__oa_1 = Request("email")
%>
<%
Dim Recordset1__af_1
Recordset1__af_1 = "z"
if (Request("telefon") <> "") then Recordset1__af_1 = Request("telefon")
%>
<%
Dim Recordset1__sf_1
Recordset1__sf_1 = "z"
if (Request("kontaktperson") <> "") then Recordset1__sf_1 = Request("kontaktperson")
%>
<%
Dim Recordset1__p
Recordset1__p = "z"
if (Request("beskriv") <> "") then Recordset1__p = Request("beskriv")
%>
<%
Dim Recordset1__fn_1
Recordset1__fn_1 = "z"
if (Request("ønsker") <> "") then Recordset1__fn_1 = Request("ønsker")
%>
<%
Dim Recordset1__fnradio_1
Recordset1__fnradio_1 = "z"
if (Request("ønskerbeskriv") <> "") then Recordset1__fnradio_1 = Request("ønskerbeskriv")
%>
<%
Dim Recordset1__ku_1
Recordset1__ku_1 = "z"
if (Request("eamvkontakt") <> "") then Recordset1__ku_1 = Request("eamvkontakt")
%>
<%
Dim Recordset1__kuradio_1
Recordset1__kuradio_1 = "z"
if (Request("givetlov") <> "") then Recordset1__kuradio_1 = Request("givetlov")
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_firma_STRING
Recordset1.Source = "SELECT *  FROM firma  WHERE Administrationsøkonom LIKE '%" + Replace(Recordset1__a, "'", "''") + "%' OR  Byggetekniker LIKE '%" + Replace(Recordset1__c, "'", "''") + "%' or Datamatiker LIKE '%" + Replace(Recordset1__d, "'", "''") + "%' or Finansøkonom LIKE '%" + Replace(Recordset1__e, "'", "''") + "%' or Laborant LIKE '%" + Replace(Recordset1__f, "'", "''") + "%' or Markedsføringsøkonom LIKE '%" + Replace(Recordset1__g, "'", "''") + "%' or Procesteknolog LIKE '%" + Replace(Recordset1__h, "'", "''") + "%' or Produktionsteknolog LIKE '%" + Replace(Recordset1__i, "'", "''") + "%' or navn LIKE '%" + Replace(Recordset1__ge_1, "'", "''") + "%' or  adresse LIKE '%" + Replace(Recordset1__fi_1, "'", "''") + "%' or email LIKE '%" + Replace(Recordset1__oa_1, "'", "''") + "%' or telefon LIKE '%" + Replace(Recordset1__af_1, "'", "''") + "%' or kontaktperson LIKE '%" + Replace(Recordset1__sf_1, "'", "''") + "%'  or beskriv LIKE '%" + Replace(Recordset1__p, "'", "''") + "%' or ønsker LIKE '%" + Replace(Recordset1__fn_1, "'", "''") + "%' or ønskerbeskriv LIKE '%" + Replace(Recordset1__fnradio_1, "'", "''") + "%' or eamvkontakt LIKE '%" + Replace(Recordset1__ku_1, "'", "''") + "%' or givetlov LIKE '%" + Replace(Recordset1__kuradio_1, "'", "''") + "'  ORDER BY navn"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
'  *** Recordset Stats, Move To Record, and Go To Record: declare stats variables

' 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
  If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total
  If (Recordset1_numRows > Recordset1_total) Then Recordset1_numRows = Recordset1_total
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
  If (Recordset1_last > Recordset1_total) Then Recordset1_last = Recordset1_total

End If
%>
<html>
<head>
<title>firmaweb</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style/style.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" marginwidth="0">
<table border="0" align="center">
  <tr>
    <td>
<table id="Ta01" width="980" height="760" border="1" cellpadding="0" cellspacing="0">
    <tr>
        <td colspan="2">
            <img src="billeder/top.jpg" width="980" height="58" alt=""></td>
    </tr>
    <tr>
        <td width="218" valign="top"  class="back">
        <table border="0" cellspacing="10">
  <tr>
    <td>
    <!--#include file="inc/menu.inc" -->
    </td>
  </tr>
</table>


        </td>
        <td width="762" height="702" valign="top"><br><br>
          <span class="stortext">Resultat af s&oslash;gning p&aring; valg i felter </span><br>
        <p>
  <%
If Recordset1_total = 0 then %>
</p>
<p><font size="2" face="Tahoma, Verdana" color="#FFFFFF">Der blev ikke fundet
  nogen profiler - pr&oslash;v igen og indskr&aelig;nk dine s&oslash;gekriterier.<br>
  <a href="java script:history.go(-1);">Retur til søgningsskema</a> </font></p>
<p><font face="Tahoma, Verdana" size="2" color="#FFFFFF"><a href="sog.asp?h=4&list_pos=m4">Tilbage
  til menuen</a></font></p>
<% else %>
<p><a href="sogskema.asp?user=<% = (Request("user")) %>"><font face="Tahoma, Verdana" size="2" color="#FFFFFF">Ny
  s&oslash;gning</font></a></p>
<table width="100%" border="0" cellspacing="2">
  <tr bgcolor="#CCCCCC">
    <td height="21"><b><font face="Tahoma, Verdana" size="2">Navn</font></b></td>
    <td height="21"><b><font face="Tahoma, Verdana" size="2">Kontaktperson</font></b></td>
    <td height="21"><b><font face="Tahoma, Verdana" size="2">EAMV-kontaktperson</font></b></td>
    <td height="21"><b><font face="Tahoma, Verdana" size="2">M&aring; kontaktes </font></b></td>
   
  </tr>
  <%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
  <tr bgcolor="<%
If (Repeat1__numRows Mod 2) Then
    Response.Write("#FFFF99")
Else
    Response.Write("#CCCCCC")
End IF
%>">
    <td height="21"><font face="Tahoma, Verdana" size="2"><a href="vis.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>" class="A1"><%=(Recordset1.Fields.Item("navn").Value)%></a></font></td>
    <td height="21"><font size="2" face="Tahoma, Verdana" class="A1"><%=(Recordset1.Fields.Item("kontaktperson").Value)%></font></td>
    <td height="21"><font face="Tahoma, Verdana" size="2"><a href="mailto:<%=(Recordset1.Fields.Item("email").Value)%>" class="A1"><%=(Recordset1.Fields.Item("eamvkontakt").Value)%></a></font></td>
    <td height="21"><font size="2" face="Tahoma, Verdana" class="A1"><%=(Recordset1.Fields.Item("givetlov").Value)%></font></td>
    </tr>
  <%
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Recordset1.MoveNext()
Wend

%>
</table>
<% End if %>
        </td>
    </tr>
</table>   
</td>
  </tr>
</table>
</body>
</html>
</body>
</html>
<%
Recordset1.Close()
%>


På forhånd TUSIND tak!!!!!!!!!!!!
Avatar billede terry Ekspert
28. august 2005 - 20:07 #1
I think you have a better chance of getting an answer to this question in ASP category guumisko
Avatar billede gummisko Nybegynder
28. august 2005 - 20:32 #2
hej terry!!!! og tak for din hjælp sidste gang.
Får du ikke snart et lydkort + mike??

nå, men jeg lukker og flytter spørgsmålet
Avatar billede terry Ekspert
31. august 2005 - 15:19 #3
A new soundcard and michrophone with my wages? :o)
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Dyk ned i databasernes verden på et af vores praksisnære Access-kurser

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester