Results 1 to 4 of 4
  1. #1
    RayMilhon is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085

    External Databases in VBA

    Is it possible to query a SQL Server database in VBA without linking (showing the table in the table list of the front end) I have 4 Databases (SQL Server Backend, MS Access 2010 Front Ends) that I have been tasked with combining the 4 databases into 1. I've designed the front end but now I have to combine the existing data of the 4 into the new database. I'm doing this in the front end as the 4 tables have similar fields but are structured differently. Also there are a couple of lookup tables that are the same in some of the databases but are not in the same order.



    For Example
    Database1
    Table bus_type
    bustypeid bustypedesc
    1 Commercial
    2 Senior
    3 Medi-cal
    4 Exchange
    5 Covered CA



    Database2
    Table type
    typeid Type
    1 Senior
    2 Medi-Connect
    3 Commercial
    4 Covered CA
    5 Exchange
    6 Medi-Cal

    I'd rather not clutter up the Access Front end with all of the tables in the existing 4 database plus the tables in the new merged database. Anybody know if this can be done?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    It's not cluttering. Link in the external tables. Don't waste time with code when you can solve it with a few clicks.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    You can query SQL Server with a pass through query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    My $0.02.....

    I would link to SQL Server because I use and am most familiar with DAO.
    But you can/could connect to many databases/tables using ADO. (SQLS, Oracle, DB2, Excel, ...)

Please reply to this thread with any new information or opinions.

Similar Threads

  1. uae external files
    By Jen0dorf in forum Access
    Replies: 7
    Last Post: 11-21-2015, 03:44 PM
  2. Replies: 1
    Last Post: 05-29-2013, 03:08 PM
  3. External
    By krkow in forum Forms
    Replies: 5
    Last Post: 01-14-2012, 11:45 AM
  4. External Data
    By abramenko in forum Import/Export Data
    Replies: 1
    Last Post: 10-14-2009, 12:01 PM
  5. Connect to external .mdb
    By bcobb2350 in forum Programming
    Replies: 8
    Last Post: 10-02-2009, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums