I've written a script that dumps a MySQL db to another MySQL db. The core of the script is this --->
'Begin Code
strCommand = "C:\mysql\bin\mysqldump --opt -u " & strUser & " -p""" & strPass & """ " & strSouceDB & " | C:\mysql\bin\mysql -C -u " & strUser & " -p""" & strPass & """ -h Intranet " & strDestDB
Set WshShell = CreateObject("WScript.Shell")
Set objExec = WshShell.Exec(strCommand)
'End Code
yeah... I realize the command line is ugly.
Here's the ouput from stdERR:
C:\mysql\bin\mysqldump: Got error: 1064: You have an error in your SQL syntax
near '| READ /*!32311 LOCAL */,C:\mysql\bin\mysql READ /*!32311 LOCAL */,- C READ /*!32' at line 1
I can do this ---> "WScript.Echo strCommand" and output the command line, then paste it in a
cmd window and it runs flawlessly. So the command line is being built correctly... or so I think.
So my guess is that WScript.Exec( ) is dying somehow because of strCommand.
I've tried the Chr(34) method instead of escaping the quotes around strPass (yes
they have to be there cause the password is complex). Either method gives me the same result.
Please help.... TIA