How to Change the Connection UserId ProgrammaticallyLast reviewed: September 17, 1995Article ID: Q136773 |
The information in this article applies to:
SUMMARYThis article shows how to create a connection that can be used by several users, and it shows how to base a view on the connection. The view gets the user name and password without prompting for it. To achieve this, set the userid and password properties of the connection programmatically as users log in. To modify the userid and password properties of a connection, the database (.dbc file) must be opened exclusively.
MORE INFORMATIONIf you create a connection, such as this:
CREATE CONNECTION myconnect ; DATASOURCE sqlsrvr ; USERID sa ; PASSWORD passwdyou can create views based on this connection, and then modify the connection at run time to allow each user to use this connection. To change the userid and password properties of the connection, use DBSetProp() in the following manner:
...=DBSetProp('myconnect','connection','userid','<newuserid>') ...=DBSetProp('myconnect','connection','password','<newpassword>')This connection uses the new userid and password to log in. You need exclusive use of the .dbc file to make this change.
|
Additional reference words: 3.00 VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |