How to connect to MS Access using DAO

IRApublic - Dec 6, 2009 at 06:27 AM
 Broskmojel - Apr 7, 2010 at 09:12 PM
how can I connect to a MS Access database using the DAO connection??i badly need your help..

1 reply


First you need to open a reference by : Project -> References -> Click on : Microsoft DAO 3.6 Object Library

Dim db As DAO.Database
Dim rs As DAO.Recordset

then use the following code in form load:

Set db = OpenDatabase("\Chat.mdb")
Set rs = db.OpenRecordset("select * from NIckname")