VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This is code to find out Records from a Access Database

by Abhay Dogra (1 Submission)
Category: Databases/Data Access/DAO/ADO
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 30th October 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



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


Download this snippet    Add to My Saved Code

This is code to find out Records from a Access Database Comments

No comments have been posted about This is code to find out Records from a Access Database. Why not be the first to post a comment about This is code to find out Records from a Access Database.

Post your comment

Subject:
Message:
0/1000 characters