Error using Movelast command

Error using Movelast command

Post by diggg.. » Sun, 10 Sep 2000 00:41:07



I am using MS Access 2k and I am having problems with using the
MoveLast command.  I am coding a POS application in VB 6 and I find
that the Movelast command stops "seeing" the end of table after about
90 or so records.  Any help would be appreciated. i am supporting
backward movement for the cursor and everything seems to work fine
until i hit 90 or so records. Thanks in advance

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

1. Error occurs when using MovePrevious and MoveLast method.

hi,

i wrote some simple code to open a recordset by using ADO, it works well
when i use this method to open the recordset:
  rsMain.Open SQL, cnnStr, adOpenDynamic

however, when i use the following code to open it, error occurs on
MovePrevious (error 3219) and MoveLast (error -2147217884)methos:
  cnnMain.Open cnnStr
  rsMain.CursorType = adOpenDynamic
  Set rsMain = cnnMain.Execute(SQL)

The codes are as follows:

Private cnnMain As New ADODB.Connection
Private rsMain As New ADODB.Recordset

Private Sub Command1_Click()
  With rsMain
    .MovePrevious
    If .BOF Then
      MsgBox "BOF"
      .MoveFirst
    End If
  End With
  fillForm
End Sub

Private Sub Command2_Click()
  With rsMain
    .MoveNext
    If .EOF Then
      MsgBox "EOF"
      .MoveLast
    End If
  End With
  fillForm
End Sub

Private Sub Form_Load()
  openDB
  fillForm
End Sub

Private Sub fillForm()
  With rsMain
    Text1.Text = .Fields(0) & ""
    Text2.Text = .Fields(1) & ""
    Text3.Text = .Fields(2) & ""
  End With
End Sub

Private Sub openDB()
  Dim dbSrc As String
  Dim dbProv As String
  Dim cnnStr As String
  Dim SQL As String

  dbSrc = "tradpkcn.mdb"
  dbProv = "Microsoft.Jet.OLEDB.4.0"
  cnnStr = "Provider=" & dbProv & ";Data Source=" & dbSrc
  SQL = "SELECT * FROM tblInvh"

' *** error occurs when MovePrevious and MoveLast using this method ***
  cnnMain.Open cnnStr
  rsMain.CursorType = adOpenDynamic
  Set rsMain = cnnMain.Execute(SQL)

'  *** it works well when use this method to open the recordset ***
'  rsMain.Open SQL, cnnStr, adOpenDynamic

End Sub

thanks

Kwok-ho

2. MONTREAL & OTTAWA Developers

3. Inaccurate Recordcount, even using Movelast !!!

4. Help. How should I go about this?

5. Unable to Addnew/Update/movelast by using ADO in ASP

6. PDX5: custom toolbars

7. Help: Using movelast on Active Server Page

8. Stored Procedure

9. Using CommandPtr queries and MoveLast

10. MoveFirst / MoveLast Error

11. ADO .movelast error in recordset

12. MoveLast() error

13. MoveLast and CommitTrans errors with DAO 3.5