I use Visual studio 2008
I use MYSQL 5.1
I want only to backup database Test to to a specific directory.
I use the application settings to determine which directory(see attachment).

Green shaded code works perfect.
Red shaded code works not!! This is with My.settings.
I can not see the error code, it goes too fast, I can not capture this with:

Try

Catch ex As Exception
MsgBox (ex.Message)
End Try


Can someone tell my what is wrong or what I need to change so it works?

Thanks,

Andre

Process.Start("C:/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump.exe", " --host=localhost --user=my --password=12345 --databases test > -r ""c:\backup\backup.sql"" ")   

Process.Start("C:/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump.exe", " --host=localhost --user=my --password=12345 --databases test > -r ""My.Settings.Locbackup""")
Attachments Application_setting.pNG 13.74 KB

try

Process.Start("C:/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump.exe", " --host=localhost --user=my --password=12345 --databases test > -r " & chr(34) & My.Settings.Locbackup & chr(34))

most of time its all about the quotes.

Edited 6 Years Ago by GeekByChoiCe: n/a

Sorry, i have one more question
No i have only the directory in My.settings.
so => c:\backup\

No i want to put the file name after the path in de string, See example (red)
But how must i do that ?

Process.Start("C:/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump.exe", " --host=localhost --user=my --password=12345 --databases test > -r " & chr(34) & My.Settings.Locbackup & chr(34) "filename.txt" )

Process.Start("C:/Program Files/MySQL/MySQL Server 5.1/bin/mysqldump.exe", " --host=localhost --user=my --password=12345 --databases test > -r " & chr(34) & io.path.combine(My.Settings.Locbackup , "filename.txt") & chr(34))

This question has already been answered. Start a new discussion instead.