Results 1 to 5 of 5
  1. #1
    gammaman is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    56

    Run update query located in another access database

    Is it possible to run an update query located in another access database?



    Something like?

    Code:
    Dim db,db2 as Database
    
    Set db = CurrentDatabase()
    Set db2 = "My other database location"
    
    DoCmd.OpenQuery "RUN A QUERY FROM DB2", , acReadOnly

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    no, but you could link the external db table, and import the query to your db,
    THEN run the query.

  3. #3
    gammaman is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Mar 2013
    Posts
    56
    Quote Originally Posted by ranman256 View Post
    no, but you could link the external db table, and import the query to your db,
    THEN run the query.
    Ok, thanks. My database currently has 60 queries and is still growing. Is there any point when it could become a problem?

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Ok, thanks. My database currently has 60 queries and is still growing. Is there any point when it could become a problem?
    I have seen a lot more than that!

    Queries are not like data, they are just code. So queries themselves do not take up much space.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by ranman256 View Post
    no, but you could link the external db table, and import the query to your db,
    THEN run the query.
    This code here will do the trick.

    Code:
    Dim wrk As Workspace
    Dim db As DAO.Database
    
    Set wrk = CreateWorkspace("AccessWorkspace", "admin", "", 2)
    Set db = wrk.OpenDatabase("\\Server\Folder\DB_Name.accdb")
    db.Execute "qryTest"

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

Similar Threads

  1. Replies: 2
    Last Post: 09-05-2014, 11:06 AM
  2. Replies: 5
    Last Post: 02-12-2014, 12:13 PM
  3. Replies: 1
    Last Post: 05-08-2013, 07:08 PM
  4. Replies: 5
    Last Post: 05-16-2012, 12:48 AM
  5. Replies: 0
    Last Post: 12-06-2011, 11:01 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