Creating An OLEDB Connection From Excel To SQL
- by Soo
I am looking to run SQL queries using VBA code in an Excel file. It may sound like a bad way to do things, but the purpose of this is to support legacy functionality on a project I'm working on.
I figured out how to create an ODBC connection, but it requires several steps which may be troublesome to implement on many computers, so I'm looking into the possibility of using OLEDB to get the job done.
My question is how to go about setting things up so I can run SQL queries in Excel using VBA.