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""")

Recommended Answers

All 5 Replies

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.

Thanks, This works fine

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))

Thanks again , this is what is was looking for!!!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.