-
جستجو در شی ado
:blush: :blush: جستجو در شی ado
--------------------------------------------------------------------------------
با سلام
من یک برنامه با شی ado نوشته ام که می خواهم عمل جستجو را انجام دهم و این جستجو به صورت دستی است (جستجو با کلیک کردن یک کلید) من را راهنمایی کنید
با تشکر.....
-
Sub ADOFindRecord()
Dim cnn As New ADODB.Connection
Dim rst As New ADODB.Recordset
' Open the connection
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=.\NorthWind.mdb;"
' Open the recordset
rst.Open "Customers", cnn, adOpenKeyset, adLockOptimistic
' Find the first customer whose country is USA
rst.Find "Country='USA'"
' Print the customer id's of all customers in the USA
Do Until rst.EOF
Debug.Print rst.Fields("CustomerId").Value
rst.Find "Country='USA'", 1
Loop
' Close the recordset
rst.Close
End Sub