|
-
Aug 30th, 1999, 08:16 PM
#1
Thread Starter
Junior Member
OK, I finally understand (I sincerely hope) how to connect to a database with ADO. Now I'd like to be able to do something like use a simple Find function. You'd think there would be some examples in Help, but instead it seems like every help topic in VB6 is about how wonderful everything Microsoft does and how much more wonderful everything is going to be in the future, and how simple it all really is. How do you do a simple Find?
------------------
-
Aug 30th, 1999, 10:29 PM
#2
You can try something like this:
Code:
Dim rs As New ADODB.Recordset
Dim cn As New ADODB.Connection
cn.Provider = "Microsoft.Jet.OLEDB.3.51"
cn.Open "D:\Microsoft Visual Studio\VB98\Nwind.mdb", "admin", ""
rs.Open "Select * from Customers", cn, adOpenStatic
rs.Find "CompanyName like 'Blauer*'"
If rs.EOF Then
MsgBox "Record not found."
Else
MsgBox "You found your record."
End If
rs.Close
Set rs = Nothing
cn.Close
Set cn = Nothing
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|