[AccessD] Loadfromtext

Gustav Brock Gustav at cactus.dk
Tue Sep 26 04:12:38 CDT 2006


Hi Martin

You could do this a bit differently by just reading the first four lines of every file found in that directory ignoring the filenames.

Except for modules it is quite easy from these four lines to determine which kind of object the file contains.
Module files are just write-outs of the modules, but if you are a neat programmer, the first line read would be Option Explicit.
Of course, if your directory contains nothing but files with saved objects, any file not parsable for an object other than a module will be a module.

/gustav


Martin Reid wrote:

>I want to loop over a folder contain X number of text files. Any ideas. For example
> 
>Application.LoadFromText acForm, "test", "C:\forms\Form_Customer List.txt"
>
>Instead of a single file I need them all BUT some are prefixed FORM, REPORT,MODULE, QUERY and I need to change the constant accordingly.
> 
>I know I can run one process for each type but would it be possible to do them all in the proper squence in one hit.
> 
>Martin
> 
>Martin WP Reid
>Training and Assessment Unit
>Riddle Hall
>Belfast





More information about the AccessD mailing list