DB CONNECT Question
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Security, Permissions & Auditing
I have a question on how to change the connection of database server in a
4gl program. I tried to use CONNECT TO statement in dbaccess but I was
prompted to input password. How can I pass a password in the CONNECT TO
statement? Which version of Informix SQL and Informix 4GL have this
feature?
Also, I have read a note talking about .netrc. is it work in my case? if
so, how can I set it up?
Thanks for your help!
Anthony Chan
Anthony Chan wrote:
> I have a question on how to change the connection of database server in a
> 4gl program. I tried to use CONNECT TO statement in dbaccess but I was
> prompted to input password.
That's DB-Access's idea of a joke. It assumes that you are
running it interactively. If that isn't valid for you, use
SQLCMD from the IIUG software archives -- but be aware that
it requires the password written out in the SQL script, which
has its own, different (security) problems.
> How can I pass a password in the CONNECT TO
> statement? Which version of Informix SQL and Informix 4GL have this
> feature?
I4GL 7.30 does; ISQL 7.30 might, but probably doesn't.
> Also, I have read a note talking about .netrc. is it work in my case? if
> so, how can I set it up?
Doubtful.
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.95 -- see http://www.perl.com/CPAN
#include <disclaimer.h>
Anthony Chan wrote:
> I have a question on how to change the connection of database server in a
> 4gl program. I tried to use CONNECT TO statement in dbaccess but I was
> prompted to input password.
If your .netrc is setup correctly, you can hit <ENTER> at this point without
inputting a username and password. You would then connect as the current
"user".
> How can I pass a password in the CONNECT TO
> statement? Which version of Informix SQL and Informix 4GL have this
> feature?
If its 4GL, why don't you use the DATABASE statement.
> Also, I have read a note talking about .netrc. is it work in my case? if
> so, how can I set it up?
Here's a typical .netrc entry. The read, write & execute permissions for
group and other must be 0.
machine starfire11 login informix password itsgreat
machine, login and password are keywords that may not be changed.
>
>
> Thanks for your help!
>
> Anthony Chan
You can use the connect keyword e.g.
database sysmaster
display "you are now connected to sysmaster"
database yourdatabase
display "you are now connected to yourdatabase"
Julian Mummery
http://go.to/codecutters/
In article <89eak2$epc$1@unix2.glink.net.hk>,
"Anthony Chan" <manlungc@hongkong.com> wrote:
> I have a question on how to change the connection of database server
in a
> 4gl program. I tried to use CONNECT TO statement in dbaccess but I
was
> prompted to input password. How can I pass a password in the CONNECT
TO
> statement? Which version of Informix SQL and Informix 4GL have this
> feature?
>
> Also, I have read a note talking about .netrc. is it work in my case?
if
> so, how can I set it up?
>
> Thanks for your help!
>
> Anthony Chan
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.