Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21251

Searching with ADODC error

$
0
0
hi i'm currently working on project to search in access db but i always get error said method or data member not found

here is my code

Code:

Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
  DisplayRecord
  If Adodc1.Recordset.EOF Then
    Adodc1.Caption = "Record: EOF of " & Adodc1.Recordset.RecordCount
  Else
    Adodc1.Caption = "Record: " & Adodc1.Recordset.AbsolutePosition & " of " & Adodc1.Recordset.RecordCount
  End If
End Sub



Private Sub Form_Load()
  DisplayRecord
End Sub

Private Sub TxtFind_Change()
  If Not Trim(TxtFind.Text) = "" Then
    TxtFind.Text = UCase(TxtFind.Text)
    TxtFind.SelStart = Len(TxtFind.Text)
   
    Adodc1.Recordset.Find "no_berkas LIKE '" & TxtFind.Text & "%'", , , 1
   
    If Adodc1.Recordset.EOF Or _
      Adodc1.Recordset.BOF Then
      Adodc1.Recordset.MoveFirst
    Else
      Text1.Text = Adodc1.Recordset.Fields(0)
      Text2.Text = Adodc1.Recordset.Fields(1)
      Text3.Text = Adodc1.Recordset.Fields(2)
      Text4.Text = Adodc1.Recordset.Fields(3)
      Text5.Text = Adodc1.Recordset.Fields(4)
      Adodc1.Caption = _
        "Record: " & Adodc1.Recordset.AbsolutePosition & " of " & _
                    Adodc1.Recordset.RecordCount
    End If
  Else
    TxtFind.Text = ""
  End If
End Sub

Private Sub DisplayRecord()
  If Not Adodc1.Recordset.EOF And _
    Not Adodc1.Recordset.BOF Then
    Text1.Text = Adodc1.Recordset.Fields(0)
    Text2.Text = Adodc1.Recordset.Fields(1)
    Text3.Text = Adodc1.Recordset.Fields(2)
    Text4.Text = Adodc1.Recordset.Fields(3)
    Text5.Text = Adodc1.Recordset.Fields(4)
  End If
End Sub

thanks

Viewing all articles
Browse latest Browse all 21251

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>