How to connect as different user using dbaccess ?
Posted in 2004
Topics: Server Administration, Security, Permissions & Auditing
Hi there,
pretty stupid question but I can't find an answer yet : how to provide
user name and password if I want to use dbaccess ?
So far I tried dbaccess - - <<!
connect to dbname user 'user' using 'passwd';
!
32412: USING clause unsupported. DB-Access will prompt you for a
password.
Error in line 1Near character position 34
I also tried
dbaccess -cc 'dbname' <<!user
password
!
and ended with
USER NAME >>userpasswd
Enter the login name you want to use for this connection.
------------------------------------------------ Press CTRL-W for Help
--------
Any ideas ?
Regards,
Sergiy
smitin@gmail.com wrote:
Do:
> connect to dbname user 'user';
DBAccess will prompt for a passwd. DBAccess will not accesp the USING
clause. However, you cannot do this using a 'here script' because the
password prompt goes directly to the tty NOT to stdin. Your best bet would
be to use Jonathan Leffler's sqlcmd utility instead:
sqlcmd -d mydatabase -u username -p password <<!
SELECT.....
!
Sqlcmd is available for download from the IIUG Software Repository.
Art S. Kagel
> Hi there,
>
> pretty stupid question but I can't find an answer yet : how to provide
> user name and password if I want to use dbaccess ?
> So far I tried dbaccess - - <<!
> connect to dbname user 'user' using 'passwd';
> !
>
> 32412: USING clause unsupported. DB-Access will prompt you for a
> password.
> Error in line 1> Near character position 34
>
> I also tried
> dbaccess -cc 'dbname' <<!> user
> password
> !
>
> and ended with
>
> USER NAME >>userpasswd
> Enter the login name you want to use for this connection.
>
> ------------------------------------------------ Press CTRL-W for Help
> --------
>
> Any ideas ?
>
> Regards,
> Sergiy
>