ADO 2.7 Array Error
Secara tidak sengaja saya menemukan kesalahan pada ADODB versi 2.7 yakni kesalahan array, kesalahan array disini maksudnya kita tidak bisa mengambil nilai yang tersimpan dari recordset secara acak, Misalnya pada code berikut ini :
Private Sub CboSuplier_Click()
Set RsSuplier = Nothing
Set RsSuplier = New ADODB.Recordset
StrSuplier = "Select [Suplier Id],[Suplier Name] " & _
"From Suplier Where [Suplier Id] = '" & _
Trim(CariKodeData(CboSuplier.Text)) & "'"
RsSuplier.Open StrSuplier, Conn, adOpenDynamic, adLockOptimistic
If RsSuplier.RecordCount <> 0 Then
TxtNamaSuplier.Text = Trim(RsSuplier.Fields("Suplier Name").Value)
TxtKodeSuplier.Text = Trim(RsSuplier.Fields("Suplier Id").Value)
End If
End Sub
Akan terjadi kesalahan “Run-time Error ’3201′ Either BOF or EOF is true, or the current record has been deleted. Requested operation requires is current record“, sebenarnya kesalahan ini terjadi karena kita mengambil data pada recordset (membinding data dari recordset ke control textbox) dilakukan secara acak (tidak berurutan) jika kita perhatikan kode listing diatas tidak bermasalah secara logical. Tetapi jika binding dilakukan secara berurutan permahasalah diatas tidak akan terjadi seperti code dibawah ini
If RsSuplier.RecordCount <> 0 Then
TxtKodeSuplier.Text = Trim(RsSuplier.Fields("Suplier Id").Value)
TxtNamaSuplier.Text = Trim(RsSuplier.Fields("Suplier Name").Value)
End If
Berurutan maksudnya disini sesuai urutan field yang dilakukan saat query.
StrSuplier = "Select [Suplier Id],[Suplier Name] " & _
"From Suplier Where [Suplier Id] = '" & _
Trim(CariKodeData(CboSuplier.Text)) & "'"
Semoga programer lainnya yang menggunakan ADO 2.7 bisa terbantu dari tulisan ini.
Incoming search terms:
- either bof or eof is true or the current record has been deleted vb6
- either bof or eof is true or the current record has been deleted
- Either BOF or EOF is True or the current record has been deleted Requested operation requires a current record
- either bof or eof is true
- BOF EOF
- runtime error 3201 either bof or eof is true or the current record has been deleted
- runtime error either bof or eof is true
- error array maksudnya ?
- error EOF atau BOF artinya apa?
- maksud dari Either BOF or EOF is True or the current record has been deleted





stmikbg.com adalah web untuk komunitas bagi anak-anak stmik bumigora khususnya dan anak-anak IT umumnya, baek yang cupu maupun yang expert.