Determine calling file

L

Lars Brownies

User opens logon.mde which does some actions (backup, update, usercheck,
etc.). After that this mdb opens the frontend.mde and closes itself. I need
to make sure that users always open the frontend by opening the logon.mde.
So they shouldn't be able to (accidentally) open the frontend directly.

Is there a way to do a check in de frontend whether it is opened directly or
by the logon.mde?

I was thinking about writing a temp file by the logon.mde, which gets
checked and deleted by the frontend.mde, but maybe there is a better way?

Thanks in advance.
Lars
 
A

Arvin Meyer [MVP]

Lars Brownies said:
User opens logon.mde which does some actions (backup, update, usercheck,
etc.). After that this mdb opens the frontend.mde and closes itself. I
need to make sure that users always open the frontend by opening the
logon.mde. So they shouldn't be able to (accidentally) open the frontend
directly.

Is there a way to do a check in de frontend whether it is opened directly
or by the logon.mde?

I was thinking about writing a temp file by the logon.mde, which gets
checked and deleted by the frontend.mde, but maybe there is a better way?

If the Logon.MDE is not open, there is no way to check without a log file.
Also, in your code to write the log file, have it check for the existence of
one before writing a new one. Or the alternative is to just keep appending a
record to the file instead of deleting it.. Then you also have a record of
logon activity.
 
L

Lars Brownies

Thanks.
Lars

Arvin Meyer said:
If the Logon.MDE is not open, there is no way to check without a log file.
Also, in your code to write the log file, have it check for the existence
of one before writing a new one. Or the alternative is to just keep
appending a record to the file instead of deleting it.. Then you also have
a record of logon activity.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
D

Dirk Goldgar

Lars Brownies said:
User opens logon.mde which does some actions (backup, update, usercheck,
etc.). After that this mdb opens the frontend.mde and closes itself. I
need to make sure that users always open the frontend by opening the
logon.mde. So they shouldn't be able to (accidentally) open the frontend
directly.

Is there a way to do a check in de frontend whether it is opened directly
or by the logon.mde?

I was thinking about writing a temp file by the logon.mde, which gets
checked and deleted by the frontend.mde, but maybe there is a better way?


As an alternative to Arvin's suggestion, you could have logon.mde start
frontend.mde via a Shell command that specifies a particular command line
parameter, using the /cmd command-line switch. Frontend.mde would check the
return value of the Command() function to see if the "secret password" was
passed.

Of course, this could be spoofed if someone knew the required command-line
value and specified that while starting the frontend.mde directly. On the
other hand, that gives you, the developer, a "back door" way to get in
without having to go through logon.mde.
 
L

Lars Brownies

This works excellent! Thanks.
Lars

Dirk Goldgar said:
As an alternative to Arvin's suggestion, you could have logon.mde start
frontend.mde via a Shell command that specifies a particular command line
parameter, using the /cmd command-line switch. Frontend.mde would check
the return value of the Command() function to see if the "secret password"
was passed.

Of course, this could be spoofed if someone knew the required command-line
value and specified that while starting the frontend.mde directly. On the
other hand, that gives you, the developer, a "back door" way to get in
without having to go through logon.mde.

--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 

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