 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Chris [CapitalC] Guest
|
Posted: Fri Sep 15, 2006 11:43 pm Post subject: Using TQuery and ODBC with a database password |
|
|
Hello,
I currently have a FileMaker Pro database which I am connecting to from
Delphi. The connection works fine using a TQuery (and optionally a
TDataSource and Tdbgrid to display). However, my problem is, since I
have a password on the database, I either have to supply a username and
password at the start of the program for an active connection or when
it attempts to connect for a non active connection. What I am looking
for is a way to hard code the password in so that it doesn't have to be
entered each time. There doesn't seem to be an adequate property in
TQuery to allow me to do this. Any ideas?
Thanks,
Chris Jamieson |
|
| Back to top |
|
 |
DB-1 Guest
|
Posted: Fri Sep 15, 2006 11:58 pm Post subject: Re: Using TQuery and ODBC with a database password |
|
|
"Chris [CapitalC]" wrote:
| Quote: |
Hello,
I currently have a FileMaker Pro database which I am connecting to from
Delphi. The connection works fine using a TQuery (and optionally a
TDataSource and Tdbgrid to display). However, my problem is, since I
have a password on the database, I either have to supply a username and
password at the start of the program for an active connection or when
it attempts to connect for a non active connection.
What I am looking
for is a way to hard code the password in so that it doesn't have to be
entered each time. There doesn't seem to be an adequate property in
TQuery to allow me to do this. Any ideas?
|
I Dunno about FileMaker pro specifically, but usually those UID +PW are
passed using Delphi's TDatabase component.
TDataBase component
-------------------
LoginPrompt Property
Description
The LoginPrompt property is used to control how security is handled for
SQL databases.
If True, (the default), the standard Delphi Login dialog box will be
opened when the application attempts to establish a
database connection. The user must then enter a proper user name and
password to connect to a database on the server.
If False, then an application will look for login parameters in the
Params property of the TDatabase component. These are
the USERNAME and PASSWORD parameters. For example,
USERNAME = SYSDBA
PASSWORD = masterkey
So try to connect your TQuery to a TDataBase, and add the UID +PW pair
there, to the Parameter values.
DB-1 |
|
| Back to top |
|
 |
Chris [CapitalC] Guest
|
Posted: Sat Sep 16, 2006 1:02 am Post subject: Re: Using TQuery and ODBC with a database password |
|
|
Oh that is perfect. It took me awhile to get the TQuery to connect to
the TDataBase but that is exactly what I was looking for.
Thanks a lot,
Chris
DB-1 wrote:
| Quote: | "Chris [CapitalC]" wrote:
Hello,
I currently have a FileMaker Pro database which I am connecting to from
Delphi. The connection works fine using a TQuery (and optionally a
TDataSource and Tdbgrid to display). However, my problem is, since I
have a password on the database, I either have to supply a username and
password at the start of the program for an active connection or when
it attempts to connect for a non active connection.
What I am looking
for is a way to hard code the password in so that it doesn't have to be
entered each time. There doesn't seem to be an adequate property in
TQuery to allow me to do this. Any ideas?
I Dunno about FileMaker pro specifically, but usually those UID +PW are
passed using Delphi's TDatabase component.
TDataBase component
-------------------
LoginPrompt Property
Description
The LoginPrompt property is used to control how security is handled for
SQL databases.
If True, (the default), the standard Delphi Login dialog box will be
opened when the application attempts to establish a
database connection. The user must then enter a proper user name and
password to connect to a database on the server.
If False, then an application will look for login parameters in the
Params property of the TDatabase component. These are
the USERNAME and PASSWORD parameters. For example,
USERNAME = SYSDBA
PASSWORD = masterkey
So try to connect your TQuery to a TDataBase, and add the UID +PW pair
there, to the Parameter values.
DB-1 |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|