Can I automate the creation of the mdw file?

A

A C

Hi

Is it possible to programatically create a new mdw (with the same ids etc)
which I can then use to link to a secured database?
For example I have an existing user level secured database (and associated
mdw somewhere but lets assume its not always available), and create a
distributable xxx.mdb which has 2 function
-recreate the mdw
-launches (via Shell) the secure access database using this mdw and
user/password which was set up in the database.

This way I wont have to worry about people not having the mdw as xxx.exe
creates it each time.

Is this possible, and does anyone have any code snips for doing it?

Thanks
AC
 
T

TC

Gosh, that seems very convoluted. Why not just supply the workgroup
file together with the database file?

Ways to create a workgroup file through code:

1. Some time /after/ Access 97, they added a VBA statement to create a
workgroup file. I can't remember, off hand, the name of that statement
or what version of Access it was added in. It is something like
CreateWorkgroupFile, or NewWorkgroupFile, or NewSystemDb, or somesuch.
Some google searching will probably find it for you.

2. The "TSIMDW" DLL was able to create workgroup files in versions up
to Access 97. Not sure about the later Access versions. Google for that
name, you should be able to find it easily.

3. If all else fails, you could always write a program which takes an
example suitable workgroup file, reads it in using the normal file I/O
commands (open, get, eof etc.), and writes out, to a new file, the
actual VBA statements required to initialize an array with the relevant
content.

For example, if the first 3 bytes of the example workgroup file were
01, 05, 2A, your program could create a new file containing the
following actual lines:

b(1) = &h01
b(2) = &h05
b(3) = &h2A

Then you could copy & paste those lines into code, within your
database, which again used the normal file I/O statements to recreate a
file with that content.

Far better just to provide the workgroup file together with the
database, IMHO.

HTH,
TC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top