The following code will loop through a directory (hardcoded) looking for mdb's, and then loops through each table in the databases that it finds - still no processing of the records though
Dim db As Database
Dim sDBName As String
Dim sFolderName As String
Dim td As TableDef
Dim rs As Recordset
sFolderName = "C:\vb projects\vb6\adox catalog"
sDBName = Dir(sFolderName & "\*.mdb"

' look for mdb's
Do Until sDBName = "" ' if mdb found, sDBName will hold the name of the first db
Set db = Workspaces(0).OpenDatabase(sFolderName & "\" & sDBName, False, False)
For Each td In db.TableDefs
If UCase(Left(td.Name, 4)) <> "MSYS" And td.Attributes <> dbSystemObject Then
Set rs = db.OpenRecordset(td.Name, dbOpenSnapshot)
' open text file here
Do Until rs.EOF
' process each record
' write out line to text file
rs.MoveNext
Loop
rs.Close
' close text file
End If
Next
Set db = Nothing
sDBName = Dir ' move to next database
Loop
To run the code, set a reference to DAO 3.51 in your project.
Simon [sig][/sig]