I've got a routine that works with password-protected tables. I want
to be able to give the passwords so that the user (who doesn't know
the passwords anyway) won't be asked to provide them. I've used
session and addPasswords without problem. However, at the end of the
routine, when I remove the password that's been given and, if the
password were already in effect prior to running the routine, I have
now changed the system so that the password is not in effect.
I don't want to provide a password within my routine if that password
is already in effect. I can't figure out how to tell that - if I use
an "open", for instance, and then test for the failure, Pdox would've
already asked for the password. Anyone know a way to do this?
I've also tried opening another session and then add the password
only to the new session. I couldn't figure out a way to tell the
existing routines to use the new session only. Any help there?
TIA.
Bob
> However, at the end of the routine, when I remove the password that's
> been given and, if the password were already in effect prior to running
> the routine, I have now changed the system so that the password is not
> in effect.
the easiest thing would be a global var that you TRUE/FALSE when the
password is still hanging from another open instance of the table.. then,
if it's FALSE when you close *this* instance (there are no other hanging
chads), you can remove the password..
--
Steven Green - Waldorf Maryland USA
Diamond Software Group
http://www.diamondsg.com/main.htm
Paradox Support & Sales - Corel CTech Paradox
---------------------------------------------------
Diamond Sports Gems
http://www.diamondsg.com/gemsmain.htm
Trading Cards and other Sports Memorabilia
---------------------------------------------------
To use sessions, create a session, create a project alias, add a
password to the session, then open a form whose datamodel is defined
using that project alias. To revoke, close the form and session. You
will not be able to close the session if user has opened a anything with
that alias.
In my app when changing users I close every open window first to make
sure all passwords are cleared. I use several levels of passwords. To
see if a password is needed I check the user rights to a table. My
first password level will almost always let a table be opened, even if
the user can't view any fields. Checking the user rights lets me know
if a higher level password is required.
Mark b.
The idea using a new session with password was that, when I'm through
with it, I can close it and all the open passwords will be deleted
with it. I think that we're saying the same things there. However,
I'm just running scripts and tCursors, etc and I don't know of any way
to tell those things to use the new session. I open the new session,
add the password to that new session and, as soon as I run a query
against one of the password-protected tables, I'm asked to provide the
password again - patently the query is using the "base" session, not
the new one I've started. Does that make sense?
Bob