Alex Rivera | Logout

Excel VBA - connect to sql with a trusted connection (no uid/pwd)

Asked 2009-10-15T17:01:35.767
12

Is there a way to have Excel connect to Sql Server using the current user's network windows authentication (trusted connection/integrated security)? I don't want to rely on a sql login or have a uid/password in my code.

Edit
Report

1 Answer

17

I have this connectionstring in an Excel 2003 VBA project...

"Provider=SQLOLEDB;Data Source=[You DB Name];Trusted_connection=yes;"

And it works for me! (I'm using ADODB)

answered 2011-05-27T09:56:11.667

Your Answer