Access denied

thart21

Registered User.
Local time
Today, 02:55
Joined
Jun 18, 2002
Messages
236
I have my db on a shared drive with a link to my .bat file through our intranet home page. It works great for all who have permission to the folder I placed the db in, but when our auditing dept, which does not have access to this folder(and will not) tried to open the db through the link, their systems freeze up completely.

I don't want to give them access, but I need some type of "Access denied" error code to show up so they can just click "ok" and get out of it instead of rebooting their system.

Would I put an On Error code in the "On Open" of my form? (this is the first screen that comes up when the db is accessed)

(I don't know why, if they should not have access to it, they would be trying to get into it again, but the boss wants it anyway).

Any ideas would be helpful and appreciated!

Toni
 
Hey Toni,

Is the .bat file in a different folder than the db? and do the users have access that folder? (does the batch file run for them? or does the PC "freeze" before that?).

If the batch file runs, then add an "IF" statement to it (I can help you quickly with that).

If the batch file doesn't run (because they don't have access to that file), then I think you are going to have to do some web stuff. If you log into your intranet site, then create a group (if one hasn't been already) and choose to show the link only to those members. Even if you don't log in, you could choose to show the link depending on the users IP (remote_host) - assuming your using something server-side (like ASP or Coldfusion).

Let us know,
-Sean
 
Thanks for the quick response!

Yes, the batch file runs for them. It locks up when it tries to go into the shared folder and open the db. The batch file is located through a link on our intranet home page, which they do have access to.

I would really appreciate help with the IF statement in the batch file!

Thank you!
 
No problem Toni!

here's a quick sample:

@echo off
if not exist \\Server\Directory\*.* goto err_msg
M:\folder\dbname.mdb
goto done
:err_msg
@echo on
@echo You do not have permission for this folder.
@echo Press any key to close this window.
@pause>nul
:done

Now, at my work we don't restrict specific folder - only drives. So this will probably need some tweaking if both folders are in the same drive (not sure really).

Anyways, the above will leave the dos screen on with an error message for those who do not have access. It simply looks for any file in that drive - if it cannot find it, then it goes to our custom error message (err_msg)

Let us know if it works for you!

-Sean
 

Users who are viewing this thread

Back
Top Bottom