This is code to find out Records from a Access Database
This is code to find out Records from a Access Database
API Declarations
'This is code to find out Records from a Access Data base
Dim con As Connection
Dim com As Command
Dim rec As Recordset
Rate This is code to find out Records from a Access Database
(1(1 Vote))
Private Sub Command1_Click()
Set con = New Connection
Set rec = New Recordset
Set com = New Command
'connecting with the datasource
With con
.ConnectionString = "d:\search.mdb"
.Provider = "Microsoft.jet.OLEDB.4.0"
.Open
End With
'executing the command
With com
.ActiveConnection = con
rec.Open "select * from vtable", con, adOpenDynamic, adLockOptimistic
End With
'Finding the record
While Not rec.EOF
If rec(1) = Trim(Text1.Text) Then
MsgBox "Recored Found"
'displaying the records
Text2.Text = rec(0)
Text3.Text = rec(1)
Text4.Text = rec(2)
Text5.Text = rec(3)
End If
rec.MoveNext
Wend
End Sub
This is code to find out Records from a Access Database Comments
No comments yet — be the first to post one!
Post a Comment