>Hi to all,
>
>I create my remote views from a Connection item of the database.
>I want to set the userid and password after the login form, so I've created the connection item only with DataSource, and I set userid and password using DBSETPROP('myConnection', 'CONNECTION', 'UserId', username).
>I've noted that the property userid and password aren't tmp, if I close app and modify my connection item I can see my last userid and password used.
>My problem is, if my database with connection item is in a Lan and is shared by all user, I can have a situation like this:
>
>- The user USR without rights on my Oracle DB start app, do the login,
>- The system manager SYS (all rights) start app and do the login. Now in the connection are setted userid and password of system manager.
>- The user USR open a form with some remote views, these views are loaded from DB like if USR was System Manager (last connected).
>
>What can I do ?
>I looking a solution to do 1 connection (using SQLConnect) at the start of app and remote views have to use this connection without asking login screen again.
>
>TIA
You've stumbled into big flaw in VFP's implementation of remote views. And there's not an easy solution, IMO. Some people create a separate database on the workstation that contains a connection and the views. Then you can use DBSETPROP() to configure the username and password. Another solution is to have the application log in with one username and password for all users. In this case, your application will have to handle permissions.
If you're using NT and MS SQL Server (which it looks like your not) you can configure SQL Server to use NT authentication. In which case, it doesn't matter what values are placed in the username and passwork properties of the connection.
And of course, you can always throw away remote views and implement everything with SPT.
-Mike