Can any 1 tell me how should I use this function?
recordset.find
Collapse
X
-
Originally posted by soranCan any 1 tell me how should I use this function?
Hi,
it is a simplle work, Please try this and refer the vb msdn Help
Dim ObjCon As New ADODB.Connectio n
Dim Rst As New ADODB.Recordset
Dim mark As Variant
Dim count As Integer
count = 0
ObjCnn.Open "Driver=Microso ft Access Driver (*.mdb);dbq=" & App.Path &"\Library.m db"
Rst.Open "SELECT title_id FROM titles", ObjCnn, _
adOpenStatic, adLockReadOnly
Rst.Find "title_id LIKE 'B*'"
Do While Rst.EOF <> True
Debug.Print "Title ID: "; Rst.title_id
count = count + 1
mark = Rst.Bookmark
Rst.Find "title_id LIKE 'B*'", 1, adSearchForward , mark
Loop
Rst.Close
Comment