Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 22nd, 2003, 03:02 AM
Registered User
 
Join Date: Sep 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Object or provider is not capable of performing re

hello there,
im getting below error in my program of database paging using ASP and MySql Server .
error:

ADODB.Recordset error '800a0cb3'

Object or provider is not capable of performing requested operation.

/db_paging_array.asp, line 58


<%
Option Explicit

Const adOpenStatic = 3
Const adLockReadOnly = 1
Const adCmdText = &H0001

Dim CONN_STRING
'CONN_STRING = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database.mdb")
CONN_STRING = "DSN=medcente-test"


Dim iPageSize
Dim iPageCount
Dim iPageCurrent
Dim strOrderBy
Dim strSQL
Dim objPagingConn
Dim objPagingRS
Dim iRecordsShown
Dim iFieldCount
Dim iRecordCount
Dim LoopRecordCount
Dim pageNum
Dim counter
Dim markShowPage
Dim I, J

iPageSize = 6

If Request.QueryString("page") = "" Then
    iPageCurrent = 1
Else
    iPageCurrent = CInt(Request.QueryString("page"))
End If

strSQL = "SELECT * from data1 order by name asc;"

Set objPagingConn = Server.CreateObject("ADODB.Connection")
objPagingConn.Open CONN_STRING

Set objPagingRS = Server.CreateObject("ADODB.Recordset")
objPagingRS.PageSize = iPageSize
objPagingRS.CacheSize = iPageSize
objPagingRS.Open strSQL, objPagingConn, adOpenStatic, adLockReadOnly, adCmdText

iPageCount = objPagingRS.PageCount
iFieldCount = objPagingRS.Fields.Count
iRecordCount = objPagingRS.RecordCount

If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1

If iPageCount = 0 Then
    Response.Write "No records found!"
Else
    objPagingRS.AbsolutePage = iPageCurrent
'see above line where error occuring.

    Dim arrDBData
    ReDim arrDBData(iFieldCount, iRecordCount)
    LoopRecordCount = 0

    'arrDBData = objPagingRS.GetRows()

    Do While LoopRecordCount < iPageSize And Not objPagingRS.EOF
        For I = 0 To objPagingRS.Fields.Count - 1
            arrDBData(I, LoopRecordCount) = objPagingRS.Fields(I)
        Next
        LoopRecordCount = LoopRecordCount + 1
        objPagingRS.MoveNext
    Loop

    objPagingRS.Close
    Set objPagingRS = Nothing
    objPagingConn.Close
    Set objPagingConn = Nothing
End If

iRecordCount = iRecordCount - 1
iFieldCount = iFieldCount - 1
LoopRecordCount = LoopRecordCount - 1

pageNum = Round(iRecordCount/iPageSize)
If pageNum < (iRecordCount/iPageSize) Then pageNum = pageNum + 1

Response.Write "&nbsp;&nbsp;<b>Page: "
For counter = 1 To pageNum
    if counter=iPageCurrent then
        Response.Write "&nbsp;<span class=activepage>&nbsp;"
        Response.Write counter
        Response.Write "&nbsp;</span>"
        markShowPage=1
    else
        Response.Write "&nbsp;<a onclick=exitoff() href=db_paging_array.asp?page="
        Response.Write counter
        Response.Write " class=listingLink>"
        Response.Write counter
        Response.Write "</a>"
    end if
Next
Response.Write "</b>"

Response.Write "&nbsp;&nbsp;"

Response.Write "<b>"

Response.Write "<a href=db_paging_array.asp?page="
If iPageCurrent = 1 Then
    Response.Write pageNum
else
    Response.Write iPageCurrent-1
end if
Response.Write " class=listingLink>Back</a>&nbsp;&nbsp;"
Response.Write "<a href=db_paging_array.asp?page="
If iPageCurrent = pageNum Then
    Response.Write "1"
else
    Response.Write iPageCurrent+1
end if
Response.Write " class=listingLink>Next</a>"

Response.Write "</b>"

%>
<p>

<table border="1">
<%
For I = 0 To LoopRecordCount
    Response.Write "<tr>" & vbCrLf
    For J = 0 To ifieldCount
        Response.Write vbTab & "<td>" & arrDBData(J, I) & "</td>" & vbCrLf
    Next ' J
    Response.Write "</tr>" & vbCrLf
Next ' I
%>
</table>


<style>

body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}

td {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}

listingLink {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
font-weight: bold;
color: blue;
text-decoration:none;
margin-left:0px;
margin-right:0px;
}

a.listingLink:hover {
color:#FF0000;
}

activepage {
color:#ffffee;
background-color: #000033;
font-weight: bold;
}
</style>
 
Old September 22nd, 2003, 03:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 132
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Firstly, this particular forum is for feedback about the Wrox P2P site; I think you need to repost in the appropriate forum (one of the ASP ones, I'd guess). Secondly, when you do repost, try to provide some useful information, such as which line of code causes the error.

Chris


There are two secrets to success in this world:
1. Never tell everything you know





Similar Threads
Thread Thread Starter Forum Replies Last Post
Is this right way for performing a slient install? SatheshKumar .NET Framework 1.x 0 August 4th, 2006 02:56 AM
Performing an IF test in a DataGrid RichardOrmiston ASP.NET 1.0 and 1.1 Basics 1 December 15th, 2005 11:08 AM
aspx subclass capable? nnnnnpatel ASP.NET 1.0 and 1.1 Basics 1 October 28th, 2004 08:09 AM
Performing Division in XSLT... Please help.. kiril XSLT 3 May 17th, 2004 05:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.