How to dynamically change Userid/Password for connectivity? [message #84590] |
Thu, 01 April 2004 08:35 |
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 |
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 |
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
|
|
|
|
|