Home » Developer & Programmer » Forms » How to dynamically change Userid/Password for connectivity?
How to dynamically change Userid/Password for connectivity? [message #84590] Thu, 01 April 2004 08:35 Go to next message
GK
Messages: 22
Registered: January 2001
Junior Member
hi,

I have a form A that I am running usind a fake db connection userid and password combo..... say USER1/PASS1.  Now, what I want to do is in the "WHEN-NEW-FORM-INSTANCE" trigger, modify the connection string to the correct values (say USER2/PASS2) so that the form can proceed with connecting to the database correctly.

How may I do so?  Any help appreciated!

regards,
GK
Re: How to dynamically change Userid/Password for connectivity? [message #84591 is a reply to message #84590] Thu, 01 April 2004 11:10 Go to previous messageGo to next message
jan
Messages: 71
Registered: August 2002
Member
you'll have to use on-logon trigger for this purpose.
when-new-form-instance trigger fires after the on-logon trigger.

here is what you would like to do..

1. create a on-logon trigger and call the logon built-in.

logon(user2,password2,connectstring);

NOTE: please check the syntax of the logon.

hope this helps.

Jan
Re: How to dynamically change Userid/Password for connectivity? [message #84600 is a reply to message #84591] Fri, 02 April 2004 06:11 Go to previous messageGo to next message
GK
Messages: 22
Registered: January 2001
Junior Member
hi Jen,

I found out that if I invoke the form without a connection string and then do the logon() within the ON-LOGON trigger as "user2", all works well!

But, if I invoke the form with a connection string (for "user1") and then do the logon() within the ON-LOGON trigger as "user2", it does not do the user change. It still retains the initial user connection.

Any ideas?

- GK
Re: How to dynamically change Userid/Password for connectivity? [message #84602 is a reply to message #84600] Fri, 02 April 2004 09:38 Go to previous messageGo to next message
jan
Messages: 71
Registered: August 2002
Member
in this case you can always logout user1 and then logon as user2.

i.e. in on-logon trigger

logout;
logon(user2,password2,connectstring);

------

This way you'll logout as user1 and then logon using user2.

hope this helps

Jan
Re: How to dynamically change Userid/Password for connectivity? [message #84603 is a reply to message #84602] Fri, 02 April 2004 10:35 Go to previous message
GK
Messages: 22
Registered: January 2001
Junior Member
Thanks a billion, Jan!!!
Previous Topic: Tutorial for D2k
Next Topic: HP OpenView Web Launcher and Oracle Forms
Goto Forum:
  


Current Time: Mon May 06 16:14:10 CDT 2024