Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connection to MSSQL

Status
Not open for further replies.

mejiaks

IS-IT--Management
Jun 9, 2003
131
HN

I am using ODBC to connect my APP to the Backend along with a Connection on the DBC
The Connection points to the System ODBC, now here is my Issue

When I am in developer machine I provided the user and password to the connection in order to retrieve the data, however, I wouldnt do this on the Client side since this compromises the security of the data. Now my question

In my scenario, what would I have to do in order to dynamically pass the user and password to the connection so the only one knowing this is my APP?

What I want to avoid is to store the user and passw on the conection and somebuddy open the project using VFP and read this information.

TIA
 
Your best bet is to not use MSSQL users but make use of windows authentification. You'd simply select to use windows authentification in your ODBC DSN, it would not contain a user and it's password. Another option is to not provide these infos and have an interactive login dialog.

On the SQL Server side you'll need to set up permissons per windows account. With the usage of user groups this is much less pain as you might think right now.

Bye, Olaf.
 
Mejiaks,

I agree with Olaf that Windows authentication is always preferable. But this depends on how the server is configured, and developers don't always have control over that.

If Windows authentication is not possible, you'll either have to store the password somewhere or prompt the user for it. Once you have obtained the password (and login name), you can pass it to the server via parameters to SQLCONNECT(). If you omit those parameters, SQL Server will prompt for them, which is not desirable because you have no control over the behaviour of the prompt.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
I've never used it in a production system (due to a lack of need), but you might also explore Application Roles as another alternative.

--------------
SQLS metasearch
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top