Sure. Here is the DAO code to open a database and load a grid with the data in one of the tables.
Code:
Option Explicit
Public g_DB As Database
Private Sub Form_Load()
Dim dsLinks As Recordset
Dim intRow As Integer
Set g_DB = Workspaces(0).OpenDatabase(App.Path & "\" & "music.mdb")
Set dsLinks = g_DB.OpenRecordset("Select * from [Internet Resources] order by Description", dbOpenSnapshot)
dsLinks.MoveLast
grdLinks.Rows = dsLinks.RecordCount + 1
dsLinks.MoveFirst
Do While Not dsLinks.EOF
intRow = intRow + 1
grdLinks.row = intRow
grdLinks.col = 0
grdLinks.Text = CStr(intRow)
grdLinks.col = 1
grdLinks.Text = dsLinks!Description
grdLinks.col = 2
grdLinks.Text = dsLinks!Url
dsLinks.MoveNext
Loop
grdLinks.row = 1
End Sub
You will also need to go to Project>References and select the Microsoft DAO 3.51 Object Library (or the latest one you have).
[Edited by MartinLiss on 03-19-2000 at 01:19 PM]