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 857613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:25:33+00:00 2026-05-15T08:25:33+00:00

A co-worker has inherited a Microsoft Access macro that executes a series of SQL

  • 0

A co-worker has inherited a Microsoft Access macro that executes a series of SQL operations against a Sybase database by calling OpenQuery on a bunch of action queries, which use linked tables over ODBC. I would like to help him convert it to an SQL script that we can execute directly against the database. And since we have quite a few macros like this, I’d like to come up with a conversion tool.

(Unless one already exists, in which case, please direct me to it.)

I expected to be able to access the details of the macro using COM interop. So far I haven’t been able to find a way to get to those details. Here’s what I have so far.

Imports Access = Microsoft.Office.Interop.Access
Imports System.Runtime.InteropServices

Module Module1

    Sub Main()
        Dim app As New Access.Application()
        app.OpenCurrentDatabase("c:\test.mdb")
        Dim macro As Access.AccessObject = app.CurrentProject.AllMacros("Macro1")
        'Do something with variable "macro"???'
        app.Quit(Access.AcQuitOption.acQuitSaveNone)
        Marshal.FinalReleaseComObject(app)
    End Sub

End Module

I don’t think any of the members of AccessObject provide the information I need. But I can’t find anything else that even mentions macros. Anybody ever done anything like this? Is there some DoCmd or SysCmd operation that will work here?

(By the way, I know that once I get the SQL I’ll have the task of converting it to Sybase SQL. I’ll cross that bridge when I come to it.)

  • 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-15T08:25:33+00:00Added an answer on May 15, 2026 at 8:25 am

    If it would be helpful to dump the macro definitions to text files, try something like this:

    application.saveastext acMacro, "Macro1", "Macro1.txt"
    

    You could then open the text files and read the Action and Argument statements.

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

Sidebar

Related Questions

My application has many classes, worker threads, and background service operations. Notifications can come
The database has a ton of entries that were not escaped because they were
I inherited a small Microsoft Enterprise Library project that supposedly worked a couple of
I have a large body of legacy code that I inherited. It has worked
I'm currently working with a system that has inherited a DAL using .Net's strongly
my co-worker has just create a new branch in the git repository which we
I am using this Web worker which has a Global variable declared in it.
My app has a worker thread, and I use PostMessage to send a string
I have developed an app that in testing has worked fine but when it
I have a list of dates that a machine has worked on, but it

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.