Showing posts with label trusted. Show all posts
Showing posts with label trusted. Show all posts

Monday, March 19, 2012

Error Creating DSN using odbcconf.exe for SQL Server

hi there

i want to create a DSN using command line arguments,with Trusted connection=no, Login name= sa password=*******

i try creating like this

C:\>odbcconf.exe /a {CONFIGSYSDSN "SQL Server" "DSN=blabla|Description=blablubb|SERVER=vsnet1|Trusted_Connection=no |Database=dm"}

this work fine, but when i specify the login id & password as

C:\>odbcconf.exe /a {CONFIGSYSDSN "SQL Server" "DSN=blabla|Description=blablubb|SERVER=vsnet1|Trusted_Connection=no|loginid=sa|password=sysadm|Database=dm"}

this throws an error as

CONFIGSYSDSN: Unable to create a data source for the 'SQL Server' Driver: Invalid keyword-value pair with error code :2147467259

I too try the

loginID, login id, login , user, userid, uid

Password, pwd

and many more...

all these throws same error.

Please help me.

Regards,

Thnaks.

Gurpreet S. Gill

Persistence of login credentials in a DSN is not supported (it's insecure). Using trusted connection would be the best way to achieve connecting without specifying credentials since the logged on user credentials is used for authenticating to the server. The command below should create the DSN for you.

odbcconf.exe /a {CONFIGSYSDSN "SQL Server" "DSN=blabla|Description=blablubb|SERVER=vsnet1|Trusted_Connection=Yes|Database=dm"}

Hope this helps

Uwa.

|||

Thanks Uwa Agbonile

this is right, that it is insecure, is there any way to do that, i mean the registry (regedit), or else?

Regards,

Thanks.

Gurpreet S. Gill

|||

Like I suggested already, one secure way to do this is to use integrated security. If you must use SQL Server authentication your options depend on the circumstances of your application. You could code the application to request the credentials from the user or retrieve them from a location you know to be secure.

You could also embed the credentials as part of the connection string directly in your application but again this is insecure and not recommended.

Regards,

Uwa.

|||

Uwa--

I understand, what you want to say.

Thanks for your help.

Regards

Gurpreet S. Gill

Error Creating DSN using odbcconf.exe for SQL Server

hi there

i want to create a DSN using command line arguments,with Trusted connection=no, Login name= sa password=*******

i try creating like this

C:\>odbcconf.exe /a {CONFIGSYSDSN "SQL Server" "DSN=blabla|Description=blablubb|SERVER=vsnet1|Trusted_Connection=no |Database=dm"}

this work fine, but when i specify the login id & password as

C:\>odbcconf.exe /a {CONFIGSYSDSN "SQL Server" "DSN=blabla|Description=blablubb|SERVER=vsnet1|Trusted_Connection=no|loginid=sa|password=sysadm|Database=dm"}

this throws an error as

CONFIGSYSDSN: Unable to create a data source for the 'SQL Server' Driver: Invalid keyword-value pair with error code :2147467259

I too try the

loginID, login id, login , user, userid, uid

Password, pwd

and many more...

all these throws same error.

Please help me.

Regards,

Thnaks.

Gurpreet S. Gill

Persistence of login credentials in a DSN is not supported (it's insecure). Using trusted connection would be the best way to achieve connecting without specifying credentials since the logged on user credentials is used for authenticating to the server. The command below should create the DSN for you.

odbcconf.exe /a {CONFIGSYSDSN "SQL Server" "DSN=blabla|Description=blablubb|SERVER=vsnet1|Trusted_Connection=Yes|Database=dm"}

Hope this helps

Uwa.

|||

Thanks Uwa Agbonile

this is right, that it is insecure, is there any way to do that, i mean the registry (regedit), or else?

Regards,

Thanks.

Gurpreet S. Gill

|||

Like I suggested already, one secure way to do this is to use integrated security. If you must use SQL Server authentication your options depend on the circumstances of your application. You could code the application to request the credentials from the user or retrieve them from a location you know to be secure.

You could also embed the credentials as part of the connection string directly in your application but again this is insecure and not recommended.

Regards,

Uwa.

|||

Uwa--

I understand, what you want to say.

Thanks for your help.

Regards

Gurpreet S. Gill

Friday, February 17, 2012

Error at: The user is not associated with a trusted SQL Server connection

Hi I've got a common error using SQL server 2005

"The user is not associated with a trusted SQL Server connection"

I'm building a application using C# when using a standalone environment, it worked well. But, now I have the following environment.

A.
SQL server
Domain XXX

B. Remote machine
Application
Domain YYY

I changed SQL server to support SQL and WIN authentication mode and I have changed SQl server surface area configuration to support TCP/IP and Named Pipes for remote connections. But I still have two problems:

1. When using the IP - serverName of the dataserver, the error is

System.Data.SqlClient.SqlException: Login failed for user ''. The user is not associated with a trusted SQL Server connection..

1. When using the server name(MYServerName), I have this error:
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Besides, I have tried from my remote machine to use a sqlcmd -E -S tcp:myhost command but I have the same answer.

Any help, I will thank.I believe you set Mixed Authentication in your SQL server in the domain XXX.
And you have an NT login in the application YYY domain.

You could try two things:

Check if you have the same NT login in XXX domain.
The XXX domain needs to trust the YYY domain to allow this to occur. You
could use SQL Server authentication instead if you don't want this trust to
occur. Trouble is you need to pass the password for the SQL login, but worth to try.|||this should work as long as the xxx domain trusts the yyy domain. if it doesn't, windows auth won't work.

is it possible to login to a box in XXX with an nt account in YYY? if not then there is no trust.