Showing posts with label odbcconfexe. Show all posts
Showing posts with label odbcconfexe. 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