Click to See Complete Forum and Search --> : ADO HELP ASAP


faatimah
April 19th, 2001, 05:12 PM
Hey all,
I am searching a table called employees by lastname.How do i display by record after i've found it.??

Dim c As New ADODB.Connection
Dim rs As New ADODB.Recordset

c.Open ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\CaseStudies\Mscb.mdb;Persist Security Info=False")

prompt: pstrLastName = InputBox("Enter name", "Find")
If pstrLastName <> "" Then

rs.Open "Select * from Employees", c, adOpenStatic

rs.MoveFirst
rs.Find "LastName = " & "'" & pstrLastName & "'"
Else
MsgBox "Enter name"

GoTo prompt

End If

//////////thank u for yr help///////////
fatima