Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 841399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:47:20+00:00 2026-05-15T05:47:20+00:00

I am looking to run SQL queries using VBA code in an Excel file.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:47:20+00:00Added an answer on May 15, 2026 at 5:47 am

    Both ODBC and OLEDB require data providers installed on the target machine. If by “several steps which may be troublesome” you meant installing these, there’ll be a little difference.

    Provided your target operating systems don’t include Windows versions below XP, and your target database is in this list of databases supported by MDAC by default, then you won’t have to do anything special. You’d create an ADODB.Connection object and open it using one of the connection strings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been looking for a way to do complex queries like SQL can perform
I would like to have an easy way to run queries like the following
I have a pregenerated CSV file on which I need to run SQL queries.
I'm looking for solution how can run Ruby script without invoking it directly like
When I run my code then JLabel is looking behind the JPanel . Why
I am looking for a way to run a python program that listens to
I've been using Microsoft SQL Server Management Studio for multiple manual SQL queries for
I'm looking to run a batch file on windows xp professional which creates a
I am looking into using log shipping in a SQL Server 2005 environment. The
I am looking for a possibility to run an (Oracle) SQL without querying an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.