Results 1 to 4 of 4

Thread: SQL vs Query

  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    SQL vs Query

    I am writing a number of append queries to import new data into my tables, but I am wondering if this is the most efficient way to do so. I have looked at these queries' SQL views, and the code required would be short enough to use in a RunSQL macro command. These queries, once all is in place, would not be run separately, as the entire update process would be macro-controlled.

    Would it be more efficient to run this operation using OpenQuery or RunSQL macro commands, or is there any real difference. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: SQL vs Query

    No, it wouldn't be better to use RunSQL. Saved queries are optimized in Access 2000, while the select statement itself is not. However, there's nothing wrong with using the OpenQuery action in a macro to run a series of append queries. I often do this when I'm prototyping an application before I build the code itself.
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Youngstown, Ohio, USA
    Posts
    705
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: SQL vs Query

    Would it make any difference if the database is a base .mdb file or if it has been converted to a .mde file?

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: SQL vs Query

    RunSQL is the slowest available method, and I would never recommend using macros in an MDE. You don't convert a database to an MDE unless it is thoroughly error trapped, and of course, you can't error trap macros, only code. In code, you're better off using the Execute method to run a query than using RunSQL.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •