Results 1 to 3 of 3
  1. #1
    Ed1138 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2014
    Posts
    9

    How to do a MS Access Update query for a table in external database

    Hi,


    Im trying to perform an update query on a table that its on a separate database, so far i have this SQL:

    Code:
    UPDATE [F:\QA_Daily_YTD_Report_Export.accdb].[YTD-Daily_Report] AS EXT_DB
    SET EXT_DB.Category1 = "1"
    WHERE (EXT_DB.Category1 = "status1");
    When i run this it returns an "invalid operation" error.

    Any idea what im doing wrong?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    Would be easy if you set a link to the table.

    I have run DELETE and INSERT on table in another database, not sure of syntax for UPDATE, if it's even possible. Can't find anything.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Ed1138 is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Sep 2014
    Posts
    9
    Thanks for the advice, I ended up using VBA:
    Code:
    Dim SQL As String
    Dim db_external As Database
    Set db_external = OpenDatabase(CurrentProject.Path & "\QA_Daily_YTD_Report_Export.accdb")
    SQL = "UPDATE [YTD-Daily_Report]" & Chr(13) & _
     "SET [YTD-Daily_Report].Category1 = '" & New_value & "'" & Chr(13) & _
     "WHERE ([YTD-Daily_Report].Category1= '" & Look_up_value & "');"
    db_external.Execute SQL

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

Similar Threads

  1. Replies: 1
    Last Post: 05-29-2013, 03:08 PM
  2. Update Table Based on External File
    By 2tMonte in forum Import/Export Data
    Replies: 6
    Last Post: 02-05-2013, 07:20 PM
  3. Replies: 5
    Last Post: 05-16-2012, 12:48 AM
  4. A way to force Access to update external file?
    By gkun in forum Import/Export Data
    Replies: 0
    Last Post: 10-27-2009, 06:11 PM
  5. Replies: 2
    Last Post: 10-27-2009, 07:09 AM

Tags for this Thread

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