Showing posts with label authentication. Show all posts
Showing posts with label authentication. Show all posts

Thursday, March 29, 2012

DSN Problems

I have a SQL Server 2000 system dsn that uses SQL Server authentication.
The DSN does not retain the password field entry I make. I enter the
password (the sql login is already there), click next, next then ok.
When I reopen the DSN, the password table is blank again. Help
appreciated.

Thanks,
Frank

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!"Frank Py" <fpy@.proactnet.com> wrote in message
news:3fd614b8$0$196$75868355@.news.frii.net...
> I have a SQL Server 2000 system dsn that uses SQL Server authentication.
> The DSN does not retain the password field entry I make. I enter the
> password (the sql login is already there), click next, next then ok.
> When I reopen the DSN, the password table is blank again. Help
> appreciated.
> Thanks,
> Frank
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Passwords are not stored in DSNs, as it would be very insecure. You will
need to specify the password (and perhaps username - I'm not sure) at
connection time. This is one good argument for using Windows authentication,
if that's possible in your case. If not, you will need to investigate how to
modify your application to request a username/password from the user.

One other possibility would be to use some sort of middle tier, which would
use a single DSN for all connections to SQL Server, but this may not be
practical or desirable, depending on your application setup.

Simon|||Yes, I can use Windows Authentication. The person connecting to the DSN
is an administrator. So if I use Windows Authentication instead on this
DSN, would that be more transparent to the user? The user, who is an
administrator needs to run a Crystal Report that is connected to the DSN
without being prompted for a username and password each time. Help
appreciated. Thanks.

Frank

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!|||Frank Py <fpy@.proactnet.com> wrote in message news:<3fd635b0$0$198$75868355@.news.frii.net>...
> Yes, I can use Windows Authentication. The person connecting to the DSN
> is an administrator. So if I use Windows Authentication instead on this
> DSN, would that be more transparent to the user? The user, who is an
> administrator needs to run a Crystal Report that is connected to the DSN
> without being prompted for a username and password each time. Help
> appreciated. Thanks.
> Frank
>
> *** Sent via Developersdex http://www.developersdex.com ***
> Don't just participate in USENET...get rewarded for it!

Yes - using Windows authentication means that no username and password
should be required, in the same way as connecting with Query Analyzer
or OSQL, for example.

Simon

DSN connection w/o password

hi all

i want to connect to SQL Server using DSN.

I create a System DSN, say 'DSN_PWD', provide SQL server authentication in that step and test the connection which works fine.

Now, currently i am using a code by my seniors which is as below

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "DSN_PWD","username","password"
objConn.Close
Set objConn =Nothing

what i am concerned is that this will be saved as ASP file, i don't want any login informatoin to be saved in a physical file openly.

i have tried this but it gives error

Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")

objConn.ConnectionString="DSN=DSN_PWD;"
objConn.Open

objConn.Close
Set objConn =Nothing

Error
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user

is there any effective way?

Thanks all

Yogesh JangamYou can hardcode the username and the password within the DSN itself using the ODBC Connection Manager. Is that what you want?

-PatP|||my primary concern being security, i don't want any SQL login information to be saved in any ASP files.

I am creating DSN with SQL Authentication with Login ID/PWD entered by user

i want a method to use this DSN to create an ADODB.Connection w/o manually again typing username and password in objConn.open method

i hope i am clear ;-).......

i have looked for connection code, but most of them have login info in the Open method.

Thanks
Yogesh Jangam|||The easiest way to do this is if your IIS service runs as an NT account. Then just use Windows Authentication for your ODBC connection and you are "good to go" without any fuss at all.

If you must run your IIS Service as LocalSystem, then you need to butcher a DSN to force static SQL authentication. That would be a last resort.

-PatPsql

DSN Connection to SQL Server

I am using the code below to create a DSN connection if it does not exist. Is there a way to set the DSN to use NT Authentication?

lngResult = SQLConfigDataSource(0, _
ODBC_ADD_SYS_DSN, _
"SQL Server", _
"DSN=" & JDS_DSN_name & Chr(0) & _
"Server=" & JDS_Server_name & Chr(0) & _
"Database=RMAData" & Chr(0) & _
"UseProcForPrepare=Yes" & Chr(0) & _
"Description=RMA Database" & Chr(0) & Chr(0))Figured it out|||Try specifying "Trusted_Connection=No" attribute along with the other attributes specified in SQLConfigDataSource().