ADO Connection - Userid/Password

Hi All,

I am building a function in NAV using automation ADO. I need to get the user password who login in NAV and use it for the connectionstring to open SQL ADO connection but i know password in NAV is encrypted so error is raised when attemping to connect. Is there any way i can do this? Need your advise.

ltxt_ConnectionString := ‘Driver={SQL Server};’

  • ‘Server=’ + ptxt_ServerName + ‘;’

  • ‘Database=’ + ptxt_DatabaseName + ‘;’

  • ‘Uid=’ + ptxt_Login + ‘;’

  • ‘Pwd=’ + ptxt_Password + ‘;’;

lADOConnection.ConnectionString := ltxt_ConnectionString;

Thanks,

Richard

You can not read password from sql tables directly. you need to create one separate table where you store uname/pw and use this to log on the the sql server.

Look at these post

http://navitips.blogspot.in/2012/05/cleanest-way-for-navision-to-read-data.html

http://www.mibuso.com/forum/viewtopic.php?t=52406

http://dynamicsuser.net/blogs/waldo/archive/2008/01/06/using-stored-procedures-in-c-side.aspx

did you try

http://www.mibuso.com/forum/viewtopic.php?f=23&t=12296&start=0

http://dynamicsuser.net/forums/p/6835/29741.aspx

thanks for the reference and idea. i have come up an idea combining your ideas to made a solution. thanks again. :slight_smile: