Board index » delphi » max length of password TDatabase can take

max length of password TDatabase can take

Hi to all,

    I just wonder if anybody knows how long a password the TDatabase can
take is.  I tried 40 character long but it complained. I use Sybase
Anywhere SQL which takes password up to 128 character long( yes, ISQL
takes it fine when logging in it with the password). Any help would be
appreciated!

  werner

 

Re:max length of password TDatabase can take


Quote
Werner Leung wrote:

> Hi to all,

>     I just wonder if anybody knows how long a password the TDatabase can
> take is.  I tried 40 character long but it complained. I use Sybase
> Anywhere SQL which takes password up to 128 character long( yes, ISQL
> takes it fine when logging in it with the password). Any help would be
> appreciated!

The "AddPassword" method would employ a 15-character password in keeping
with Paradox.  But this would not be the method used for SQL.

The password for a Sybase connection would be specified in the
"PASSWORD=" connection parameter passed to the driver.  I would not
expect it to be considered by TDatabase at all.

When "it complained," what exactly did it say?

Re:max length of password TDatabase can take


Quote
> The "AddPassword" method would employ a 15-character password in keeping
> with Paradox.  But this would not be the method used for SQL.

> The password for a Sybase connection would be specified in the
> "PASSWORD=" connection parameter passed to the driver.  I would not
> expect it to be considered by TDatabase at all.

> When "it complained," what exactly did it say?

Thanks for the reply!

Maye it needs more details here: I used the TDatabase control for login and
passed in the info as follows:

procedure TDataModule1.Database1Login(Database: TDatabase; LoginParams:
TStrings);
var
        frmPassword : TfrmPassword;
begin
        frmPassword := TfrmPassword.Create(Self);
        try
            if frmPassword.ShowModal = mrOk then
            begin
                LoginParams.Values['USER NAME'] := frmPassword.UserName.Text;
                LoginParams.Values['PASSWORD'] :=
'1234567890123456789012345678901234567890';
            end
        finally
            frmPassword.Free;
        end;
end;

Then when it was trying to log on, it popped up an exception saying that
"[SQL]userid and password are invalid". Since I had no problem logging in
using ISQL with the same user id and password, I guess this error suggested
the TDatabase couldn't take password longer than 36 characters( I tried that
out). Maybe you guys can help me out here to try this out and let me know what
you think. I have no clue why this happened.

  Thanks!
 werner

Other Threads