Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Incorrect Password for Encrypted Table Results in Endless Loop?
Fri, Aug 10 2007 2:06 PMPermanent Link

Steve Caupp
Trying out encrypted DBISAM tables for a proposed project.  In the test program I prompt for the
password for the table in the main form's OnShow.  I then have this:

procedure TForm1.Button1Click(Sender: TObject);
begin
 try
   tbl.Active := True;
 except
 end;
end;

procedure TForm1.sesPassword(Sender: TObject; var Continue: Boolean);
begin
 if usTablePword <> '' then begin
   ses.AddPassword(usTablePword);
   Continue := True;
 end;
end;


If the incorrect password is entered this results in an endless loop, with

tbl.Active->OnPassword->tbl.Active etc. etc.

Is there a "built-in" way to check for a valid password, or do I just need to keep a unit level variable to see if
I'm looping and then assume the password is incorrect?

Thanks.

Mon, Aug 13 2007 4:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< If the incorrect password is entered this results in an endless loop,
with

tbl.Active->OnPassword->tbl.Active etc. etc.

Is there a "built-in" way to check for a valid password, or do I just need
to keep a unit level variable to see if I'm looping and then assume the
password is incorrect? >>

You'll have to do the latter.  DBISAM doesn't do anything more than simply
check the password and keep firing the OnPassword event as necessary.

However, you might consider changing the architecture a bit so that the
AddPassword method is called during the actual prompt of the password to the
user.  That way you'll simply keep prompting the user if the password is
invalid, and then they can select whether or not to continue trying with
different passwords.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image