Encrypting ODBC DSN login password programmatically

我怕爱的太早我们不能终老 提交于 2019-12-13 04:18:57

问题


I am using file DSN for connecting to Sybase database. Login password is encrypted and is stored with EncryptedPassword keyword in the .dsn file. I have the requirement to change the database password and update the DSN accordingly.

I am using SQLDriverConnect to connect to the database and SQLWriteFileDSN to modify the .dsn file.

Is there any way to encrypt the new given password same way Sybase does(keyword or special tag or some thing?).?

Some limitation:

  1. I know its not recommended to store password/encrypted bassword in DSN, but I can not provide the password on the run to connect call. I have to use DSN(System/User/File DSN). File DSN over others is just because it doesn't show password in a .dsn file if not encrypted.

  2. Driver using is Adaptive Server Anywhere 9.0 from iAnywhere Solutions, inc. DBODBC9.DLL. I guess its the pretty old version.


回答1:


Take a look at the dbdsn utility that is shipped with SQL Anywhere. If you use the -pe switch, the password you specify will be encrypted when the DSN is saved.



来源:https://stackoverflow.com/questions/5742018/encrypting-odbc-dsn-login-password-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!