1

I'm trying to write a VBScript that will export and import the code modules from an Access MDB file to text files.

From within the app I can loop through the DAO Container & Documents and use the 'undocumented' Application.SaveAsText method, but can I do it externally?

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
oharab
  • 4,405
  • 3
  • 19
  • 15

2 Answers2

2

Basically it is all COM, but the COM interface doesn't expose methods for opening files, using MDWs for security, etc, but minds greater than my own have found a solution to the problem at http://www.mvps.org/access/modules/mdl0036.htm. Once I've got a reference to the database, I can then use the techniques Remou and HansUp mention as normal.

oharab
  • 4,405
  • 3
  • 19
  • 15
0

It's all COM, so pretty much anything you can do from VBA in the IDE, you can do from a .vbscript file externally.

Set accessApplication = CreateObject("Access.Application")
' then do what you do from the IDE
Jeff
  • 35,755
  • 15
  • 108
  • 220