Tuesday, 14 February 2017

How to Create connection at runtime with the help of DAO reference?

1.      open New project
2.      project menu
3.      select component and open a dialog box whose name is references-Project1
4.      select Microsoft DAO 3.51 object library
5.      Write following code in general section
Dim db As Database
Dim rs As Recordset

6.      Write the following code in Load Section
Set db = OpenDatabase("C:\Users\786\Desktop\Employee.mdb")

Set rs = db.OpenRecordset("select * from Emp_Info", dbOpenDynaset)

No comments:
Write comments