[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Save file path problem with FileCopy

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?
0
koldjg
Asked:
koldjg
  • 2
1 Solution
 
hnasrCommented:
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")
0
 
koldjgAuthor Commented:
Wicked, Thanks a lot.
0
 
hnasrCommented:
Welcome!
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now