Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6725957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:52:09+00:00 2026-05-26T09:52:09+00:00

I have a script that downloads data from a database into a series of

  • 0

I have a script that downloads data from a database into a series of CSV files. After they’re downloaded, they must be loaded into an Access database for reporting (I use DoCmd.TransferText, and have a saved text import specification). Every time I run the job that generates the data and downloads into CSV, I usually need to load into a fresh copy of the unpopulated version of the Access database. Is there a way to automate this in a batch script?

In short, I need to be able to:

  • copy the unpopulated Access file to a new file with the timestamp in the name
  • load certain CSV files that match a pattern (such as “data_for_reporting_2_20111024_135142.csv”) in the directory into the Access file.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:52:10+00:00Added an answer on May 26, 2026 at 9:52 am

    I think you can use VBScript to do what you need.

    • copy the unpopulated Access file to a new file with the timestamp in
      the name

      FileSystemObject.CopyFile “c:\somefolder\template.mdb”, “c:\dest\new.mdb”

    See CopyFile Method.

    • load certain CSV files that match a pattern (such as
      “data_for_reporting_2_20111024_135142.csv”) in the directory into the
      Access file.

    You can examine the Files Collection of your CSV folder, determine which of those file names match your target pattern, then run DoCmd.TransferText with each matching file name.

    You would run DoCmd.TransferText from an Access application instance:

    Option Explicit
    Dim appAccess
    Dim strMdb
    Const cstrFolder = "c:\dest\"
    
    strMdb = "new.mdb"
    
    Set appAccess = CreateObject("Access.Application")
    appAccess.OpenCurrentDatabase cstrFolder & strMdb, False
    

    So, do the Transfertext from that instance variable:

    appAccess.DoCmd.TransferText [your options]
    

    Edit: This would be faster for me to create and test in VBA. So I think I would use that instead of VBScript.

    Create a function, SnarfCSV, in a standard module in your template MDB. Then create a macro, mcrSnarfCSV, with the SnarfCSV function as its runcode action. Then after you copy the template MDB to the new MDB, open the new one with the /x command line switch to run the macro.

    "Path to MSACCESS.EXE" "Path to your db file" /x mcrSnarfCSV
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a script (KSH script to be precise) that downloads 3 files from
I have written a watir script that downloads files. One of the files it
I have this script that will let the user download the data from the
I am working on a script that downloads various image files from the web
In one of our applications, we have a script dump data from a database
I have a script that will run on server daily to download data from
I have a PHP script that simply takes some data, separates it into tab
I have a script that retrieves objects from a remote server through an Ajax
I have a script that checks responses from HTTP servers using the PEAR HTTP
I have an script that receives an encrypted url and from that generates a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.