Help with Syntax DoCmd.CopyObject

Posted on 2007-08-06
Last Modified: 2013-11-05
I want to include the password in this procedure.  Need help with syntax.  

Here is the code.

Any help would greatly be appreciated.

Private Sub cmdTransferBackup_Click()
    DoCmd.SetWarnings False

    DoCmd.CopyObject "\\Dtcnas-mosl002\slguest\ILSPIBackup\ILSPBackup;Jet OLEDB:Database Password=XXXXXX;", "", acTable, "Backup_BuyersElectronicTradeTicketsTable_Live"

End Sub
Question by:ca1358
    LVL 11

    Accepted Solution

    You need to open the database with the password before you copy.
    Check this out:

    Author Comment

    Thank you!
    LVL 11

    Expert Comment

    No prob, glad I could help.

    TFTP  :)

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
    This article will show, step by step, how to integrate R code into a R Sweave document
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

    734 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

    23 Experts available now in Live!

    Get 1:1 Help Now