Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Run query in another database at startup

Discussion in 'Information Technology' started by Janelle.Dunlap@ge.com, Jul 28, 2006.

  1. Janelle.Dunlap@ge.com

    Janelle.Dunlap@ge.com
    Expand Collapse
    Guest

    Is there a way to write code in one database (db1) so that when I open
    another known database (db2) it will run a query that I specify at
    startup ? The query is created in db1 and I have written vb code to
    copy it over to db2. However, because of the complexity of my database
    I need to automate the process of running the query from within db1. I
    have played around with creating an AutoExec macro in db1 and copying
    it over to db2 , but I don't want the macro to run in db1, just db2.
    If I delete the macro from within db1, I will not be able to use it
    again when I want to create a new database (db3).
     
  2. Loading...


  3. Janelle.Dunlap@ge.com

    Janelle.Dunlap@ge.com
    Expand Collapse
    Guest

    Nevermind, I figured it out. Easy enough, just save the AutoExec macro
    in db1 with another name and when it's copied to db2 name it as
    "AutoExec".

    DoCmd.CopyObject strSaveFileName, "AutoExec", acMacro, "Macro"
     
  4. dbahooker@hotmail.com

    dbahooker@hotmail.com
    Expand Collapse
    Guest

    or you can use a SQL Server based Access Data Project and you can have
    real scheduling capabilities.

    you can schedule data being moved from point A to point B without
    typing a single world; it is called the 'import / export data wizard'
    or something along those lines

    it requires sql client tools; but all companies have sql server
    somewhere.

    I mean; SQL Server owns the friggin market anymore.

    I would reccomend using the SQL Server developers' edition on your
    desktop in conjunction with a couple of MSDE databases.

    it works like a charm; and it's like what.. free??

    -Aaron


    Janelle.Dunlap@ge.com wrote:
    > Nevermind, I figured it out. Easy enough, just save the AutoExec macro
    > in db1 with another name and when it's copied to db2 name it as
    > "AutoExec".
    >
    > DoCmd.CopyObject strSaveFileName, "AutoExec", acMacro, "Macro"
     

Share This Page