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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cursor Type problem 1

Status
Not open for further replies.

Faheem786

Programmer
Sep 5, 2001
30
HK
Hi there,

I use Microsoft Access 2000 as the backend and I would like to display a list of my products in the List.asp and by clicking on the product it takes the user to the detail page.

I use the getrows method to retrieve the records and display them using paging (ie 10 records per page)

*************************************************
List.asp:

<!--#include file=&quot;adovbs.inc&quot; -->
<!--#include file=&quot;CommonStrings.asp&quot; -->
<%
SQL = &quot;SELECT * FROM PRODUCTS&quot;
Set RS = Server.CreateObject(&quot;ADODB.Recordset&quot;)
RS.CursorLocation = adUseClient
RS.Open Sql, Conn , 2,2

DataArray = RS.GetRows
Conn.Close
Set Conn = Nothing

FOR i= 1 to 10 'For eg
ProductName= DataArray(Name,i)

'Displaying the List of items
%>

<a href=&quot;Detail.asp?MyQuery& &quot;AbsPosition=&quot; & i+1%&quot;> <%=ProductName %> </a></td>

<% NEXT %>

***********************************************************

Details.asp?MyQuery& &quot;AbsPosition=&quot; & i+1

<!--#include file=&quot;adovbs.inc&quot; -->
<!--#include file=&quot;CommonStrings.asp&quot; -->
<%
AbsPosition = Request(&quot;AbsPosition&quot;)

Sql = &quot;SELECT * FROM PRODUCTS&quot;
Set RS = Server.CreateObject(&quot;ADODB.recordset&quot;)
RS.CursorLocation = adUseClient

RS.Open Sql, Conn ,2,2
If AbsPosition <> &quot;&quot; Then
RS.AbsolutePosition = CInt(AbsPosition)
End If

DataArray = RS.GetRows
Conn.Close
Set Conn = Nothing

FOR i= 1 to 1 'For eg
' The product details come here
NEXT
**********************************************************

When I run the list.asp without the step
RS.CursorLocation = adUseClient it was fine with no errors

But when I use that I get the error

ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

**********************************************************

The reason I use the CursorLocation is because of my need to use the AbsolutePosition.

If I remove the RS.CursorLocation and try to go the Details.asp ends up with the following error.

**********************************************************

ADODB.Recordset (0x800A0CB3)
Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.

**********************************************************

Pls find me a way to solve these problems.

Thanks in advance.
Faheemi
 
Set your CursorType to one of the following.

RS.CursorType = 0 default
Represents a forward-only recordset. You can go forward only in this recorset type. Uses the fewest resources. Best for situations where you want to make a single pass through the records.

RS.CursorType = 1
Allows free movement through the recordset. Can see changes and deletes made by other users, but does not show additions made by other users without refreshing the recordset.

RS.CursorType = 2
Most Powerful cursos but uses the most resources. Allows full movement through the recordset. Can see additions, edits, and deletions made by other users.

RS.CursorType = 3
Fully scrollable recordset but disconnects from server after the recordset is populated. Additions, edits, and deletes made by other users are not viewable.

Hope this provides some help..

TW


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top