Results 1 to 7 of 7
  1. #1
    tryingtoquery is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2021
    Posts
    2

    New Forum User W/ A Few Questions


    I am new everyone! I am thankful to be here and i have already learned a lot.

    My first question is which query function to use (maketable, updatetable, or append) to create a local table that will store all columns of data from a linked ODBC source? The table that i am trying to copy from the ODBC contains fields that are automatically deleted after 72 hours and i want to create a local table that will store data for 60 days and then delete data that is older than 60 days. I will be creating a macro attached to a button on my main form that I will run each day so that the local table can be updated. the macro will contain a "delete" query that will delete all fields that are older than 60 days.

    2nd question.. Does anyone on here know how i can deploy a batch file that will copy the main database file to the user's desktop from a shared local network drive? I am sort of trying to create an "update-able" database in a sense. The .bat file will be an "installdb.bat" and i would like to have a .txt file that the batch file checks to see if it differs. If the txt file differs then the install.bat file would then copy the main database to the desktop again, overwriting the old file.

    In this method above the .txt file would only be changed when a major change to the main database file has been made by the database admin. The database admin would then let all of the DB users know to run the installed.bat file again.

    Thank you for any help that you can provide.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    Run a make table query to 'copy' the ODBC table to the local table.

    2. Normally you don't copy db to local users. Users share the network database as a central lookup. You don't delete tables.
    But you can write delete macros/code to remove tables.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,945
    Firstly I hope your DB is split?
    I have used Bob Larsen's Front End Updater in a few of my DBs, but some experts recommend just having a shortcut that copies the FE from the distribution folder to the users PC and run it each time?

    As ranman256 says, just run the query once to get the structure (just had a deja vu, I'm sure someone asked this before? )

    If you are going to be appending and deleting daily, you will need to compact and repair regularly as well.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    tryingtoquery is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2021
    Posts
    2
    Yes. I have already created the maketable query. Now i need to either use update, or append to keep storing the data in the table over and over. Was going to create a macro to run whichever query would work best. The reason i need to do this over and over is because the ODBC tables generally delete data that is older than 72 hours. I want to store that data for a rolling 60 day period.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,945
    What query you run would depend on whether the linked data is also updated or just appended I would have thought?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2016
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    TTQ,
    Suggest you give an example or 2 of what changes when the ODBC table gets changed. What exactly do you want to save locally? How often do the records change?

  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Does anyone on here know how i can deploy a batch file that will copy the main database file to the user's desktop from a shared local network drive?
    I note this has not been answered, but detail is sketchy to provide an answer and not clear what you mean by 'main database'. In a 'normal' setup the front end (forms/code/queries/reports) would reside in the users machine whilst the back end (tables only) would reside on the server. It doesn't sound like this is what you are doing, but if it was, you would have some code in the front end to do the necessary work, no need for a batch file.

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

Similar Threads

  1. This Forum is the Best!
    By MadTom in forum General Chat
    Replies: 2
    Last Post: 12-09-2020, 08:15 AM
  2. Hello Forum
    By D_InSub in forum General Chat
    Replies: 6
    Last Post: 07-06-2018, 12:16 PM
  3. Converting dBase forum to Access forum
    By amerifax in forum Forms
    Replies: 5
    Last Post: 07-03-2012, 01:12 AM
  4. New to this forum and have questions
    By Sinatra Fan in forum Access
    Replies: 4
    Last Post: 04-14-2006, 06:53 PM

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