BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using TQuery and ODBC with a database password

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.databases
View previous topic :: View next topic  
Author Message
Chris [CapitalC]
Guest





PostPosted: Fri Sep 15, 2006 11:43 pm    Post subject: Using TQuery and ODBC with a database password Reply with 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?

Thanks,

Chris Jamieson
Back to top
DB-1
Guest





PostPosted: Fri Sep 15, 2006 11:58 pm    Post subject: Re: Using TQuery and ODBC with a database password Reply with quote



"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





PostPosted: Sat Sep 16, 2006 1:02 am    Post subject: Re: Using TQuery and ODBC with a database password Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> comp.lang.pascal.delphi.databases All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.