-1
我想從Visual Basic中保存一個MySQL數據庫。我的代碼如下。從VB.net調用mysqldump
我收到一條錯誤消息:找不到文件。哪個文件沒有找到,我做錯了什麼?
Private Sub Backup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackup.Click
Dim StrBackup As String
Dim strUser As String = "root"
Dim strPass As String = "mysql"
Dim strDbName As String = "components"
Dim strPath As String = "c:\data"
Dim newDBName As String = "DataBackup.sql"
StrBackup = "C:\Program Files\MySQL\MySQL Server 5.6\bin\mysqldump.exe --host=localhost --user='" & strUser & "' --password=mysql """ & strDbName & """ -r """ & strPath & newDBName & """"
MsgBox(StrBackup)
Process.Start(StrBackup)
那麼這卡給我看的第一件事是,你有與c:\ dataDataBackup.sql連接的strPath&newDBName。你至少需要在那裏添加一個「\」,所以strPath&「\」&newDBName。或者將「\」添加到strPath。 – Capellan 2014-09-04 12:23:46