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

  • Home
  • SEARCH
  • 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

Has anyone worked much with Microsoft's Managed Extensibility Framework (MEF)? Kinda sounds like it's
I have a co-worker that maintains that TRUE used to be defined as 0
I have a co-worker that swears by //in a singleton Constants class public static
Any advice what has worked for you when dealing with user-entered markup, e.g. wiki
I'm using Linq2Sql for my asp.net mvc project and so far it has worked
Has anyone worked with DSLs (Domain Specific Languages) in the finance domain? I am
Has anyone worked with the StarTeam COM API (Specifically, intergrating with C#). I need
I've searched and searched but nothing has really worked. I'm trying to set a
The CodePlex team has a Slack time policy, and it's worked out very well
A co worker of mine asked me to review some of my code and

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.