Board index » delphi » How to prevent the Username/password dialog of ODBC

How to prevent the Username/password dialog of ODBC

Hi,
I'm using ODBC to access my Foxpro Database from Delphi.
Every time when I connect TDatabase to the FoxDB.
A dialog always appeard to prompt the username/password.

How can I prevent the Dialog?

There realy no need username/password!

Thanx

Henry Kowk
gu...@public.szptt.net.cn

 

Re:How to prevent the Username/password dialog of ODBC


Quote
Henry wrote:

> Hi,
> I'm using ODBC to access my Foxpro Database from Delphi.
> Every time when I connect TDatabase to the FoxDB.
> A dialog always appeard to prompt the username/password.

> How can I prevent the Dialog?

> There realy no need username/password!

> Thanx

> Henry Kowk
> gu...@public.szptt.net.cnCheck out the help on the TDatabase component.

Brian Lakstins

Re:How to prevent the Username/password dialog of ODBC


Hi,

Quote
> I'm using ODBC to access my Foxpro Database from Delphi.
> Every time when I connect TDatabase to the FoxDB.
> A dialog always appeard to prompt the username/password.

> How can I prevent the Dialog?

> There realy no need username/password!

> Thanx

> Henry Kowk
> gu...@public.szptt.net.cnCheck out the help on the TDatabase component.

Use AddPassword('MyApp') in the form create event
and RemovePassword('MyApp') in the form close event.

Why is this necessary?.
Borland must assume that EVERY database is password protected.

The advantage to this is that user name 'MyApp' will appear in any
database error message relating to locking problems or errors.

I could not find any documentation of this default behavior.  Drove me
crazy until I tried the above with a database component in a datamodule.

If you just blow by the password dialog box I think Delphi gives you
a default password of user or null or something.  I Don't recall.

2 or 3 lines of explanation in documentation or help would have saved me
numerous hours of aggravation and work.

Bill

Other Threads