vbs script to launch secure Access database

G

Guest

I would like to create a shortcut to a vbs script that will launch a secure
database.

The problem is that both the database and the workgroup file sit on a server
with a long path name, so I am running up against the 256 char limit on the
shortcut command line.

Creating a batch file has the disdavantage that the DOS window stays open
until the Access application is closed.

How would such a vbs script look like. If possible, I would also like to
determine the path to the msaccess.exe file.

TIA

Pius Frei
 
G

Guest

If you put the vb script inside the target database, you
can use Syscmd to get the path to MSACCESS,
codedb.name to get the path to the file, a windows
call to get the short path names if required, shell to
start your database with the correct workgroup
and user name, and quit to close the target database
if it was opened without security.

I had to leave "open and run" permission for Admin,
(the default user) but if the database is opened by
Admin, it just closes and re-opens with the correct
workgroup.

You can add the same kind of code to a separate database,
so that you don't have to leave open and run permission
for Admin on your target database, but there is no real
advantage. It doesn't take much longer to open, because
the dummy database is really small, and the shell runs
faster because Access is already loaded.

(david)
 
T

TC

I suspect that he's using my script, which uses the AutomationSecurity
property to suppress the security prompts from a2k3. That script must
go outside the db; it can't be done inside.

I'm not sure what to suggest to him. Can you have a UNC name that
points to a folder? Maybe that would help.

HTH,
TC
 
G

Guest

TC:

In one of your earlier posts, you suggested a .bat file. However, I have
not found the corresponding vbs code.

Yes, the both files, the database and the workgroup, can have UNC names; so
that should not be an issue.

Thanks

Pius Frei
 
T

TC

But if the individual files can have UNC names, and UNC names are
short, won't tht solve your problem?

TC
 
T

TC

Maybe I've misunderstood what you're asking.

I don't recall why I would have suggested using a BAT file. I normally
suggest a VBS script. You can find my VBS script code by searching this
group for posts from me (TC) containing the words "automationsecurity"
and "createobject".

HTH,
TC
 
G

Guest

TC:

Thank you for your pointers to this vbs script. However, is there a way to
define a workgroup file (something like "o.workgroup=path to mdw file")?

Thanks

Pius
 
T

TC

In theory: yes. In practice: no.

It's very difficult to get my method to work with a custom workgroup
file, unless you use the workgroup administrator to join to that file
before you run the script.

I've tried various methods, and I haven't found a solution that works
perfectly in all of the relevant cases:
- standard wgf where Admin does not have a password;
- standard wgf where Admin has a password;
- custom wgf where Admin does not have a password;
- custom wgf where Admin has a password.

There are some slimy hacks for doing it - eg. changing the default
workgroup file by editing the registry through code - but I'm really
not happy with any of those. So I'm normally careful to say tht the VBS
script mehod only works when the database is not secured. I think that
you will see that disclaimer in most of my previous posts on this
issue.

Cheers,
TC
 
T

TC

Sorry Pius, in that regard, I should have noticed the title of your
post. It clearly mentions that your database is secured. But your
original post did didn't say anything about my script - I only
/guessed/ that you were trying to use it. So I did not think to give
you the standard warning, that I normally give to people when I
rcommend my scipt.

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