Retrieve all data from an Access Database to a Desktop File.
Retrieve all data from an Access Database to a Desktop File.
API Declarations
Dim rc As Recordset
Dim dataPath As String
Dim dataPass As String
Dim i As Long
Dim x As Long
Rate Retrieve all data from an Access Database to a Desktop File.
(1(1 Vote))
dataPath = InputBox("Type DB adress:", "DB ADRESS", "db.mdb")
dataPass = InputBox("Type DB Password:", "DB PASSWORD", "")
Set db = OpenDatabase(dataPath, False, False, ";PWD=" & dataPass)
Open "C:\WINDOWS\DESKTOP\DB.TXT" For Output As 1
Print #1, "DB.MDB INDEX"
Print #1, String(80, "=")
Print #1, ""
For x = 0 To db.TableDefs.Count - 1
'Ignore system tables
If LCase$(Left$(db.TableDefs(x).Name, 4)) <> "msys" Then
Set rc = db.OpenRecordset(LCase$((db.TableDefs(x).Name)), dbOpenSnapshot)
Print #1, " - " & UCase$((db.TableDefs(x).Name))
For i = 0 To rc.Fields.Count - 1
Print #1, " | " & rc.Fields(i).Name
Next
Print #1, " "
Set rc = Nothing
End If
Next
Close 1
Set db = Nothing
End
End Sub
Retrieve all data from an Access Database to a Desktop File. Comments
No comments yet — be the first to post one!
Post a Comment