all groups > dotnet odbc.net > december 2004 >
You're in the

dotnet odbc.net

group:

ODBC / ASP.NET Connection - Password in Code


ODBC / ASP.NET Connection - Password in Code chuckdfoster
12/15/2004 10:19:49 AM
dotnet odbc.net:
I have developed an ASP.NET site that uses an ODBC connection to a MS SQL
Server. I have set up the ODBC connection in my web application, but have
to put the password in the properties of the OdbcConnection1. I have been
asked to try and use this ODBC connection without putting my password in the
properties.

Is it possible to set up an ODBC Connection with a user name and password,
and not have to use the password in your code?

Re: ODBC / ASP.NET Connection - Password in Code Kingsley Idehen
12/15/2004 6:41:17 PM
12/15/2004 11:19:49 AM
[quoted text, click to view]
Of Course! But you are going to need a different ADO.NET provider.
Our Multi-Tier ADO.NET Providers allow your password to be saved
outside of the realm of ADO.NET (completely) as this is stored on the
server side (a middle tier application server or DBMS server).
You can obtain our ADO.NET providers for major DBMS engines (and an
alternative ODBC provider) from: http://uda.openlinksw.com/ado.
net/mt/ (for our Multi-Tier product) and http://uda.openlinksw.
com/ado.net/ (for information in general re. our ADO.NET offerings).
Regards,

Kingsley Idehen Weblog: http://www.openlinksw.com/blog/~kidehen
OpenLink Software Web: http://www.openlinksw.com
Re: ODBC / ASP.NET Connection - Password in Code Paul Clement
12/16/2004 8:26:50 AM
[quoted text, click to view]

¤ I have developed an ASP.NET site that uses an ODBC connection to a MS SQL
¤ Server. I have set up the ODBC connection in my web application, but have
¤ to put the password in the properties of the OdbcConnection1. I have been
¤ asked to try and use this ODBC connection without putting my password in the
¤ properties.
¤
¤ Is it possible to set up an ODBC Connection with a user name and password,
¤ and not have to use the password in your code?
¤

You don't need to hard code the user name and password, but you will need to prompt the user for
this information so you can build the connection string before connecting to SQL Server.

The other alternative is to use integrated security (trusted connection). Below are links to
examples using different providers:

http://www.able-consulting.com/dotnet/adonet/Data_Providers.htm#SQLClientManagedProvider
http://www.able-consulting.com/MDAC/ADO/Connection/OLEDB_Providers.htm#OLEDBProviderForSQLServer
http://www.able-consulting.com/MDAC/ADO/Connection/ODBC_DSNLess.htm#ODBCDriverForSQLServer


Paul ~~~ pclement@ameritech.net
AddThis Social Bookmark Button