System.Runtime.InteropServices.COMException: 'Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.'
I am using Microsoft Access to connect at VBNET Studio. In the form, there are no issues but if I run it this quote appears " System.Runtime.InteropServices.COMException: 'Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.'" at the line of "tbl.movefirst()"
here is the code
Public Class Form1
Public db As New ADODB.Connection
Public tbl As New ADODB.Recordset
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TeybolTableAdapter.Fill(Me.DatabaseDataSet.Teybol)
'db.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & "C:\Users\Windows10\OneDrive\Documents\Database.accdb")
db.Open("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Windows10\OneDrive\Documents\Database.accdb")
tbl.Open("select * from Teybol", db, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
tbl.MoveFirst()
Call DisplayRecord()
Call DisabledControl()
End Sub
Public Class Form1
Public db As New ADODB.Connection
Public tbl As New ADODB.Recordset
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.TeybolTableAdapter.Fill(Me.DatabaseDataSet.Teybol)
'db.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & "C:\Users\Windows10\OneDrive\Documents\Database.accdb")
db.Open("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\Windows10\OneDrive\Documents\Database.accdb")
tbl.Open("select * from Teybol", db, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
tbl.MoveFirst()
Call DisplayRecord()
Call DisabledControl()
End Sub