WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Access

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Export MDB to Flat File


Export .MBD data to flat file
;Predefined Variables
filename = 'C:\temp\logfile.mdb'
tablename =  'Table'
outputfile = 'C:\temp\logfile.txt'
spec = ''

; Export .MBD data to flat file
oApp = ObjectCreate( 'Access.Application' ) ; Open Access Object
oConstants = ObjectConstantsGet( oApp ) ; Creates a Constants object.
oApp.OpenCurrentDatabase ( filename ) ; Open Database
oApp.Visible = @TRUE ; Make access visible( change to @false to hide)
oApp.DoCmd.TransferText( oConstants.acExportDelim, spec, tablename, outputfile, @TRUE) ; Export data

;Close objects
oConstants = 0
oApp = 0

Exit


Article ID:   W18098
Filename:   Export MDB to Flat File.txt
File Created: 2008:11:25:12:39:54
Last Updated: 2008:11:25:12:39:54