Use TransferDatabase to replace a table

Posted on 2009-04-29
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.
Question by:atreidies
    LVL 3

    Expert Comment

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

    Author Comment

    I also need to deal with rights, my desination database has limited access and i need to keep it that way
    LVL 3

    Expert Comment

    ok, I understand
    first step is check table exist in remote file
    seccond step
    build name transfered table

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

    and at the end
    use TransferDatabase with sDestination
    LVL 1

    Accepted Solution

    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.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

    730 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now