
View mdb tables rows by rows
Quote:
> but not with automation
I don't quite understand what you mean by that. Here are some DAO examples
you could use;
Option Explicit
Private m_db As DAO.Database
Private Sub Command1_Click()
Dim daoTable As DAO.TableDef
List1.Clear
For Each daoTable In m_db.TableDefs
List1.AddItem daoTable.Name
Next daoTable
End Sub
Private Sub Form_Load()
Dim DBE As New DAO.DBEngine
Set m_db = DBE.OpenDatabase("c:\directory\path\db1.mdb")
End Sub
Private Sub List1_Click()
Dim daoTable As DAO.TableDef
Dim daoRS As DAO.Recordset
Dim daoField As DAO.Field
Text1 = ""
Set daoRS = m_db.TableDefs(List1.Text).OpenRecordset
While Not daoRS.EOF
For Each daoField In daoRS.Fields
Text1 = Text1 & daoField.Name & " = " & daoField.Value & " "
Next daoField
Text1 = Text1 & vbCrLf
daoRS.MoveNext
Wend
daoRS.Close
End Sub
Add a multi-line text box a command button and a listbox to the form