?
Solved

Use TransferDatabase to replace a table

Posted on 2009-04-29
4
Medium Priority
?
418 Views
Last Modified: 2013-11-27
Using the TransferDatabase macro wont replace the object, it will add a new one.  Can It replace the object or is there a way for my database to delete the table before running the TransterDatabase cmd. Remember I am using two separate networked databases in different directories.
0
Comment
Question by:atreidies
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:prachwal
ID: 24264509
You can't use link tables? TransferDatabase  need access to diffrent file to transfer data
hmm
you can chceck object name in remote file and create name transfered table
0
 
LVL 1

Author Comment

by:atreidies
ID: 24264530
I also need to deal with rights, my desination database has limited access and i need to keep it that way
0
 
LVL 3

Expert Comment

by:prachwal
ID: 24264617
ok, I understand
first step is check table exist in remote file
http://access.databases.aspfaq.com/how-do-i-determine-if-a-table-exists-in-an-access-database.html
seccond step
build name transfered table

sDestination = "table_" & format(DATE,"YYMMDD")

and at the end
use TransferDatabase with sDestination
0
 
LVL 1

Accepted Solution

by:
atreidies earned 0 total points
ID: 24270919
Running the macro adds a new table, but when i wrote the command the code replaces it, and I dont know why. But it is working.

DoCmd.TransferDatabase acExport, "Microsoft Access", "C:\Databases\My Stuff.mdb", acTable, "VJOBHST-LOA_RFL", "VJOBHST-LOA_RFL", False

I wasnt sure what you meant by sDestination but thanks though.
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Audit trails are very important in any system to hold people responsible for certain transactions and hold them to take ownership of their actions. This article is dedicated to all novice "Microsoft Access" developers.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

601 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question