Forums

ASP

This topic is locked

alternative to Move to specific Record

Posted 28 Mar 2008 21:35:14
1
has voted
28 Mar 2008 21:35:14 Javier Castro posted:
I have been plagued with problems lately. One of them is : it seems that for some reason, the move to specific is causing problems in my application. The error I receive is the following:

<pre id=code><font face=courier size=2 id=code>Microsoft OLE DB Provider for SQL Server error '80040e14'
Could not find prepared statement with handle -1.
/admin/editpage.asp, line 235 </font id=code></pre id=code>

the error points to the following line of code:

<pre id=code><font face=courier size=2 id=code> &lt;%
' *** Move To Record: if we dont know the record count, check the display range

If (MM_rsCount = -1) Then

' walk to the end of the display range for this page
MM_index = MM_offset
While (Not MM_rs.EOF And (MM_size &lt; 0 Or MM_index &lt; MM_offset + MM_size))
MM_rs.MoveNext
MM_index = MM_index + 1
Wend

' if we walked off the end of the recordset, set MM_rsCount and MM_size
If (MM_rs.EOF) Then
MM_rsCount = MM_index
If (MM_size &lt; 0 Or MM_size &gt; MM_rsCount) Then
MM_size = MM_rsCount
End If
End If

' if we walked off the end, set the offset based on page size
If (MM_rs.EOF And Not MM_paramIsDefined) Then
If (MM_offset &gt; MM_rsCount - MM_size Or MM_offset = -1) Then
If ((MM_rsCount Mod MM_size) &gt; 0) Then
MM_offset = MM_rsCount - (MM_rsCount Mod MM_size)
Else
MM_offset = MM_rsCount - MM_size
End If
End If
End If

' reset the cursor to the beginning
If (MM_rs.CursorType &gt; 0) Then
MM_rs.MoveFirst
Else
MM_rs.Requery &lt;------------------------ this one is suppossed to be the error
End If

' move the cursor to the selected record
MM_index = 0
While (Not MM_rs.EOF And MM_index &lt; MM_offset)
MM_rs.MoveNext
MM_index = MM_index + 1
Wend
End If
%&gt;</font id=code></pre id=code>

I removed the Paging code to Move to Specific record, but I am stranded there. Is there another way to move to specific record that anyone know. Samples??

Thanks in advance.

Javier
"I'm a slow learner and I forget fast" grandpa
DW | FW | ASP | HTML | CSS

Reply to this topic