Creating An OLEDB Connection From Excel To SQL
        Posted  
        
            by Soo
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Soo
        
        
        
        Published on 2010-05-25T21:41:20Z
        Indexed on 
            2010/05/25
            22:01 UTC
        
        
        Read the original article
        Hit count: 255
        
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.
© Stack Overflow or respective owner