Save file path problem with FileCopy

Posted on 2009-04-19
Last Modified: 2012-05-06
I need to backup the database i use with my windows form application.  Im have written the following code:
Private Sub UltraButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UltraButton3.Click
        Dim DBPath As String = My.Application.Info.DirectoryPath

        FileCopy(DBPath & "C:\Users\Database.accdb", "?")

        MsgBox("Backup Successful")

My problem is the user selects the path to backup and that path goes into textbox1.  How do i get the FileCopy function to use this path?
Question by:koldjg
    LVL 30

    Accepted Solution

    Try this example:

    FileCopy (TextBox1.Text, "D:\NewLocation\Database.accdb")

    If Textbox1 does not include the database name then:

    FileCopy (TextBox1.Text & "\Database.accdb", "D:\NewLocation\Database.accdb")

    Author Comment

    Wicked, Thanks a lot.
    LVL 30

    Expert Comment


    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

    I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
    When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    755 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

    16 Experts available now in Live!

    Get 1:1 Help Now