Reputation: 139
I'm trying to do backup on VB6.
This is my code:
Private Sub Command1_Click()
Me.CommonDialog1.Filter = "*.sql"
Me.CommonDialog1.ShowSave
If Me.CommonDialog1.FileName <> "" Then
FileCopy App.Path & "C:\Users\Bea\Desktop\symptoms.sql", Me.CommonDialog1.FileName & ".sql"
MsgBox "Database had been successfully Saved on " & Me.CommonDialog1.FileName & ".sql" End If End Sub
And I get this error:
Path Not Found
What's the possible problem?
Upvotes: 1
Views: 2365
Reputation: 125749
Please learn to actually read the words in the error message. The problem is very clear.
The path at App.Path & "C:\Users\bea\Desktop\symptoms.sql"
isn't there. If App.Path
is C:\VB6Apps
, and you concatenate (add) "C:\Users\bea" to it, you end up with
"C:\VB6AppsC:\Users\bea", which obviously isn't a valid location.
Upvotes: 8