HELP: Need code to find a file on user's hard drive

  • Thread starter Thread starter Wilsoch
  • Start date Start date
W

Wilsoch

Long story short: My Access developer is letting me down. He's not very
experienced and is incredibly slow.

Situation:
Access database that will be used locally on individual user's
machines.

What I need:
I need code to make Access look for a "security" file
(C:/Temp/GCDTest.txt)located on the user's hard drive. If it finds the
file, it allows the user to continue into the application. If it
doesn't find the file, the database shuts down and does not let the
user proceed.

I'm begging and pleading for help from all of you experts. I am not a
VB programmer, and I'm not so ignorant as to think I could teach myself
how to do this in the short time I have before I need to release this.

Is anyone willing to help me with this?
 
If Dir("C:\Temp\GCDTest.txt") = "" Then
Application.Quit
End If
 
Wow. Is it really this simple? Do I put this in the first form to which
the database opens?

I'm so sorry for my ignorance; I'm really going to take a VB class now
so I don't have to rely on the people with whom I'm forced to work.
 
Put Dir("C:\Temp\GCDTest.txt") = "" as a condition in the macro
Autoexec with command Quit.
 
Well, to do what you asked is simple, yes. Exactly where you put the code
depends on exactly how you want the application to behave, but if you want
it to shut down as soon as the user attempts to open it then yes, the Open
or Load event procedures of your startup form will do nicely.

You need to be aware, though, that this will not provide a very high level
of security - a moderately intelligent and curious user won't have much
difficulty defeating this.

Tony Toews has some tips on protecting trial versions on his web site ...

http://www.granite.ab.ca/access/demo.htm
 
Thank you so much for these suggestions. I really appreciate it. I'll
look up those tips right away.

I know this idea is lacking, but it's actually passed muster. I have a
secondary security option I'm using as well.
 
Wilsoch said:
Long story short: My Access developer is letting me down. He's not
very experienced and is incredibly slow.

Situation:
Access database that will be used locally on individual user's
machines.

What I need:
I need code to make Access look for a "security" file
(C:/Temp/GCDTest.txt)located on the user's hard drive. If it finds the
file, it allows the user to continue into the application. If it
doesn't find the file, the database shuts down and does not let the
user proceed.

I'm begging and pleading for help from all of you experts. I am not a
VB programmer, and I'm not so ignorant as to think I could teach
myself how to do this in the short time I have before I need to
release this.

Is anyone willing to help me with this?

Why not use Access's own user level security?

I suggest you start by reading
http://support.microsoft.com/default.aspx?scid=kb;[LN];207793

Access security is a great feature, but it is, by nature a complex product
with a very steep learning curve. Properly used it offers very safe
versatile protection and control. However a simple mistake can easily lock
you out of your database, which might require the paid services of a
professional to help you get back in.

Practice on some copies to make sure you know what you are doing.
 

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

Back
Top