Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error '80020009'

Status
Not open for further replies.
George, if you want us to help you with this, it might help to post some of the relevant code so that we can help you to pinpoint the possible issues.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
My code is bottom:

<%@ LANGUAGE=VBScript CODEPAGE=1254 %>
<% Response.Buffer = True %>

<!--#include file="editme_.asp"-->

<%
' ADO Constants - Don't Change Them
Const adOpenForwardOnly = 0
Const adLockReadOnly = 1
Const adCmdText = &H0001
Const adUseClient = 3

Dim currentPage,sorgu

'---------------------------------------------------------------------------------------------

if request.querystring("durum")="" then
sorgu=" order by mydate desc,title asc"
end if

if request.querystring("durum")="program" then
sorgu=" order by title asc"
end if

if request.querystring("durum")="tarih" then
sorgu=" order by mydate desc,title asc"
end if

if request.querystring("durum")="dosya" then
sorgu=" order by btur desc, dosyaboyutu desc,title asc"
end if

if request.querystring("durum")="hit" then
sorgu=" order by hit desc, title asc"
end if

if request.querystring("durum") = "lisans" then
sorgu = "order by lisans asc, title asc"
end if

if request.querystring("durum") = "oy" then
sorgu = "order by pOy desc, title asc"
end if

Function tur(noo)
select case noo
case "1"
Response.Write "Freeware"
case "2"
Response.Write "Shareware"
case "3"
Response.Write "Demo"
end select
end function

If Len(Request.QueryString("currentPage")) = 0 Then
currentPage = 1
Else
currentPage = CInt(Request.QueryString("currentPage"))
End If

Dim recordsToShow
recordsToShow = 20

' Keyword/s to search
Dim strKeyword, strArray

strKeyword = Trim(Request.QueryString("lr"))
if len(strkeyword)<>0 then
strArray = split (strkeyword , " ")
end if

' Our Connection Object
Dim con
Set con = CreateObject("ADODB.Connection")
con.Open strDB

' Our Recordset Object
Dim rs
Set rs = CreateObject("ADODB.Recordset")
rs.CursorLocation = adUseClient
rs.PageSize = recordsToShow
rs.CacheSize = recordsToShow

' Searching the records for the keywords entered
if isArray(strArray) then
Select Case UBound(strArray)
Case 0 rs.Open "select * from all_pages where active<>false and altkategori_id = " &strKeyword & sorgu, con, adOpenForwardOnly, adLockReadOnly, adCmdText
Case 1 rs.Open "select * from all_pages where active<>false and altkategori_id = '%" & strArray(0) & "%' and altkategori_id = '%" & strArray(1) & "%'" & sorgu, con
Case 2 rs.Open "select * from all_pages where active<>false and altkategori_id = '%" & strArray(0) & "%' and altkategori_id = '%" & strArray(1) & "%' and altkategori_id = '%" & strArray(2) & "%'" & sorgu, con
Case Else rs.Open "select * from all_pages where active<>false and altkategori_id = '%" & strArray(0) & "%' and altkategori_id = '%" & strArray(1) & "%' and altkategori_id = '%" & strArray(2) & "%'" & sorgu, con
End Select
else
rs.Open "select * from all_pages where active<>false and altkategori_id = " &strKeyword & sorgu, con, adOpenForwardOnly, adLockReadOnly, adCmdText
end if ' If the returning recordset is not empty

%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1254">
<style>
body { font-family : Verdana; font-size : 8pt; }
</style>
<link rel="stylesheet" type="text/css" href="link2.css">
<link rel="stylesheet" type="text/css" href="link.css">
<title><%=rs("altkategori")%> - </title></head>
<body>




<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="100%" bgcolor="#387CA6">
<a href="default.asp"><b><font face="Arial" size="2" color="#FFFFFF">DTR</font></b></a><font face="Arial" size="2" color="#FFFFFF"><b><font color="#FFFFFF"> :
<%if rs("kategori") = "Ses" then %>
<a href="category.asp?cid=2">
<font color="#FFFFFF"><%=rs("kategori")%></font></a> :<%end if%>

<%if rs("kategori") = "?nternet" then %>
<a href="category.asp?cid=1">
<font color="#FFFFFF"><%=rs("kategori")%></font></a> :<%end if%>


<%if rs("kategori") = "Multimedya" then %>
<a href="category.asp?cid=3">
<font color="#FFFFFF"><%=rs("kategori")%></font></a> :<%end if%>


<%if rs("kategori") = "Oyunlar" then %>
<a href="category.asp?cid=4">
<font color="#FFFFFF"><%=rs("kategori")%></font></a> :<%end if%>


<%if rs("kategori") = "Masaüstü" then %>
<a href="category.asp?cid=5">
<font color="#FFFFFF"><%=rs("kategori")%></font></a> :<%end if%>


<%if rs("kategori") = "Web Tasar?m & Yönetimi" then %>
<a href="category.asp?cid=6">
<font color="#FFFFFF"><%=rs("kategori")%></font></a> :<%end if%>


<%if rs("kategori") = "?? & Finans" then %>
<a href="category.asp?cid=7">
<font color="#FFFFFF"><%=rs("kategori")%></font></a> :<%end if%>


<%if rs("kategori") = "Yard?mc? Programlar" then %>
<a href="category.asp?cid=8">
<font color="#FFFFFF"><%=rs("kategori")%></font></a> :<%end if%>
<font color="#FFFFFF"><%=rs("altkategori")%></font>
</tr>
</table>

<%
Dim totalpages
totalpages = rs.PageCount
rs.AbsolutePage = currentPage
' Showing total number of pages found and the current page number

dim lr,durum, baslama, bitis
baslama = Int(request.querystring("bitis") + 1)
bitis = Int((currentPage * recordsToShow))
if bitis > rs.recordcount then bitis = rs.recordcount
if baslama > bitis then baslama = INT(bitis-10)
if baslama = 0 then baslama = 1
%>
<table cellSpacing="0" cellPadding="0" width="100%" border="0">

<tr vAlign="top" bgColor="#ffcc00">
<td><img height="1" src="b.gif" width="2"></td>
</tr>
</table>

<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="100%" bgcolor="#387CA6"><b><font face="Arial" size="2" color="#FFFFFF">Bulunan:&nbsp;<%=rs.recordcount%>&nbsp;&nbsp;&nbsp;
Gösterilen:&nbsp;<%=baslama&"- "&bitis%></font></b></td>
</tr>
</table>
<table border="0" width="100%" id="table2">
<tr><br>
<td align="center">

</td>
</tr>
</table>


<table border="0" width="100%" id="table3">
<tr>
<td>
<p align="center">

</td>
</tr>
</table>

<table border="0" width="90%">
<tr>
<td width="31%"><font size="2" color="#FF0000"><b><a href="kategori.asp?lr=<%=strkeyword%>&amp;durum=program" title="Program Ad?na Göre S?rala">Program Ad?</a></b></font></td>
<td width="17%"><font size="2" color="#FF0000"><b><a href="kategori.asp?lr=<%=strkeyword%>&amp;durum=tarih" title="Tarihe Göre S?rala">Ekleni? Tarihi</a></b></font></td>
<td width="15%"><font size="2" color="#FF0000"><b><a href="kategori.asp?lr=<%=strkeyword%>&amp;durum=lisans" title="Lisans'a Göre S?rala">Lisans</a></b></font></td>
<td width="17%"><font size="2" color="#FF0000"><b><a href="kategori.asp?lr=<%=strkeyword%>&amp;durum=hit" title="Download Say?s?na Göre S?rala">Download</a></b></font></td>
<td width="20%"><font size="2" color="#FF0000"><b><a href="kategori.asp?lr=<%=strkeyword%>&amp;durum=dosya" title="Dosya Boyutuna Göre S?rala">Dosya
Boyutu</a></b></font></td>
</tr>
</table>

<table width="9%" border="0" align="right">
<tr>
<td>

</td>
</tr>
</table>
<%
Dim pOylar, poSQL, pTops
'Set pOylar = Server.CreateObject("Adodb.Recordset")
' poSQL = "Select * from Oylar where pno = "' where cevap = 'Öneriyorum'"
' POylar.Open poSQL, Con, 1, 3

' pTops = 0
' DO while not pOylar.Eof
' pTOps = pTops + pOylar("sayi")
' pOylar.MoveNExt
' Loop


'pOylar.Close
'set pOylar = nothing
' Showing relevant records
Dim rcount, i, x

For i = 1 To rs.PageSize
rcount = i
If currentPage > 1 Then
For x = 1 To (currentPage - 1)
rcount = 10 + rcount
Next
End If

If Not rs.EOF Then

Dim pOy, p1SQL, pTop
Set pOylar = Server.CreateObject("Adodb.Recordset")
poSQL = "Select * from all_pages where id = "& Rs("id") ' where cevap = 'Öneriyorum'"
POylar.Open poSQL, Con, 1, 3

pTops = 0
DO while not pOylar.Eof
pTOps = pTops + pOylar("pOy")
pTOps = pTops + pOylar("nOy")
pOylar.MoveNExt
Loop

pOylar.Close
set pOylar = nothing
if len(rs("pOy")) <> 0 then
pTop = rs("pOy")
else
pTop = 0
end if
if pTops > 0 then
pYuzde = Int((pTop/pTops) * 100)
else
pYuzde = 0
end if
%>
<table border="0" width="90%">
<tr>
<td width="31%" valign="top"><font size="2">
<%Response.Write "" & " <b><a href='program.asp?id="& rs("id") &"'>" & rs("title") & "</a></b><br>" & vbcrlf%>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" valign="top"><font size="2" face="times new roman"><%Response.Write "" & Left(rs("description"),80) & "..." & vbcrlf%></td>
</tr>
<tr>
<td width="100%" valign="top"><font size="2" face="arial"><%Response.Write "<b>OS</b>: " & rs("isletimsistemi") & "<br><br>" & vbcrlf%></font></font><b><font face="Arial" size="1"></font></b></td>
</tr>
</table>
</td>
<td width="17%" valign="top"><font size="2"><%Response.Write "" & rs("mydate") & "<br>" & vbcrlf%>&nbsp;&nbsp;&nbsp;&nbsp;<font color="#0000FF"><i><%Response.Write "" & rs("new") & "<br>" & vbcrlf%></i></font></td>
<td width="15%" valign="top"><font size="2"><%Response.Write "" & tur(rs("lisans")) & "<br>" & vbcrlf%></font></td>

<%end if%>

<td width="17%" valign="top"><font size="2"><%Response.Write "" & rs("hit") & "<br>" & vbcrlf%><i><b><%Response.Write "" & "<br>" & vbcrlf%></i></b></font></td> <td width="20%" valign="top"><font size="2"><%
if rs("btur") = "MB" then
response.write FormatNumber((rs("dosyaboyutu")/1000),1)
else
response.write rs("dosyaboyutu")
end if
response.write ""& rs("btur") &"<br><br>" & vbcrlf%></font></td>
</tr>
</table>

<table>
<tbody>
<table border="0" width="100%">
<table cellSpacing="0" cellPadding="0" width="82%" border="0">

<tr vAlign="top" bgColor="#ffcc00">
<td><img height="1" src="b.gif" width="2"></td>
</tr>
</table>
<%
rs.MoveNext

Next
Response.Write "<br>"
' Links to move through the records
If currentPage > 1 Then
Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?currentPage=" & currentPage - 1 & "&durum="& request.querystring("durum") &"&bitis="& INT((baslama - 1) - 10) &"&lr=" & Server.URLEncode(Request.QueryString("lr")) & """>Back</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
Else
Response.Write "<u style=""color : silver;""></u>"

End If



If CInt(currentPage) <> CInt(totalPages) Then

Response.Write "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?currentPage=" & currentPage + 1 & "&durum="& request.querystring("durum") &"&bitis="& INT((baslama + i) - 2) &"&lr=" & Server.URLEncode(Request.QueryString("lr")) & """>Next</a>"
Else
Response.Write "<u style=""color : silver;""></u>"
End If

%>
<p>
<%Response.Write "" & vbcrlf



' Done. Now release Objects
con.Close
Set con = Nothing
Set rs = Nothing
%>
<div align="center" style="color:silver;">&nbsp;</div>

</body>



Thank you.
 
I may have lost count of the [tt]end if[/tt]'s but it looks like it is possible that the error happens when attempting to read a recordset field like [tt]rs("btur")[/tt] when [tt]rs.EOF[/tt] is true.

If possible it might be better to re-write your [tt]For/Next[/tt] loop that is limitted by [tt]rs.PageSize[/tt] as a [tt]Do[/tt] loop limited by [tt]rs.EOF[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top