Page 1 of 1

Why this shellexecute() not work?

Posted: Fri Jul 27, 2007 10:22 am
by ShumingWang
Hi,
This not works,only shows a few top lines of the backup file d:\mysqldata.sql :
shellexecute(odlg:hwnd,,"mysqldump.exe","--opt --host 192.168.0.123 --port=3306 -u root -p -C mysqldata>d:\mysqldata.sql",,.t.)


While this works:

fp:=FCREATE("bak.bat")
FWRITE(fp,"@ECHO OFF")
FWRITE(fp,CRLF+"mysqldump.exe --opt --host 192.168.0.123 --port=3306 -u root -p -C mysqldata>d:\mysqldata.sql")
FCLOSE(fp)
WaitRun("bak.bat")
FERASE("bak.bat")

Regards!
Shuming Wang

Re: Why this shellexecute() not work?

Posted: Fri Jul 27, 2007 11:02 am
by Enrico Maria Giordano
Try

Code: Select all

shellexecute(odlg:hwnd,0,"mysqldump.exe","--opt --host 192.168.0.123 --port=3306 -u root -p -C mysqldata>d:\mysqldata.sql",0,1)
EMG

Posted: Sat Jul 28, 2007 2:01 am
by ShumingWang
EMG,
Still as before, not work.

Shuming Wang

Posted: Sat Jul 28, 2007 8:40 am
by Enrico Maria Giordano
Try without the redirection.

EMG

Posted: Sun Jul 29, 2007 7:26 am
by ShumingWang
EMG,
How?
Thanks!
Shuming Wang

Posted: Sun Jul 29, 2007 8:19 am
by Enrico Maria Giordano

Code: Select all

shellexecute(odlg:hwnd,0,"mysqldump.exe","--opt --host 192.168.0.123 --port=3306 -u root -p -C mysqldata",0,1)
EMG

Posted: Mon Jul 30, 2007 1:21 am
by ShumingWang
EMG,
mysqldata>d:\mysqldata.sql
This means from mysqldatabase 'mysqldata' backup to local file d:\mysqldata.sql . can't be cuted to 'mysqldata '.

Shuming Wang

Re: Why this shellexecute() not work?

Posted: Mon Jul 30, 2007 7:24 am
by Enrico Maria Giordano
Then try

Code: Select all

shellexecute(odlg:hwnd,0,"mysqldump.exe",'"--opt --host 192.168.0.123 --port=3306 -u root -p -C mysqldata>d:\mysqldata.sql"',0,1)
EMG

Posted: Mon Jul 30, 2007 10:00 am
by ShumingWang
EMG,
Not work still. :(
Is because of the para too long ?
Shuming Wang

Posted: Mon Jul 30, 2007 10:16 am
by Enrico Maria Giordano
I don't know, sorry.

EMG