Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.


Importing/Replacing data from external database

Importing/Replacing data from external database

I have a database in Access 07 that I need to be portable/self-contained, however, it pulls a major peice of data from a database on our internal network as well as other data from linked Excel spreadsheets. My question is, is there an easy way to set my database up so that I can pull the data from the database into a table as needed (the data just needs to be refreshed about once a week or so) replacing the old data with the new? I would also like to do the same with the linked Excel spreadsheets. This would give me the ability to use my database as a stand-alone unit without having to be connected to the internal network or constantly copying updated spreadsheets.



RE: Importing/Replacing data from external database

Apparently you want to keep local copies of linked tables/spreadsheets. This can be done by using append, delete, and/or make table queries.

The issue you may have is your forms, reports, and queries all expect tables with specific names. Your "local" copy have different names. You will need to contend with this issue by using code or queries or whatever. Let us know if you need a strategy recommendation for this.

Hook'D on Access
MS Access MVP

RE: Importing/Replacing data from external database

The most important peice of data is a site "Master" database on a sequal server. I just set up an ODBC Data link to it on my pc so the table and fields in my access database have the same names as the original. The spreadsheet fields all match in the linked tables as well. I can re-build queries and relationships if I have to in order to make things work better if need be. My biggest stumbling block will just be setting things up so I can run some sort of "Refresh" macro to update all the tables in my database with the external information. I have no problem wiping the data from the tables and just importing the most recent data from the external sources back into them. There are less than 10,000 site records so it should not take long to import data from scratch once a week.



RE: Importing/Replacing data from external database

You can write code that runs your delete and append queries like:


   Dim strQueryName as String
   strQueryName = "qdelTable1"
   Currentdb.Execute strQueryName, dbFailOnError
   strQueryName = "qappTable1"
   Currentdb.Execute strQueryName, dbFailOnError
   strQueryName = "qdelTable2"
   Currentdb.Execute strQueryName, dbFailOnError
   strQueryName = "qappTable2"
   Currentdb.Execute strQueryName, dbFailOnError
   Msgbox "Finished"
You could create a button on a form to run this code.

Hook'D on Access
MS Access MVP

RE: Importing/Replacing data from external database

It appears all is working as advertised! Thanks Duane!


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close