Page 1 of 1

Path Problem with PgDump.BackupToFile

Posted: Sun 22 Jan 2012 17:11
by hwd
Hello,

when using the following code:

Code: Select all

s:='"'+txtBackupPath.Text + '\ + strBackupFile + '.sql"';
ShowMessage(s);
PgDump.BackupToFile(s);
ShowMessage delivers
"C:\RAD Studio\Projekte\backupTest\ctswws_Standard_2012-01-22_17-52.backup.sql"
PgDump.BackupToFile results in an error
Datei "C:\RAD Studio\Projekte\CTS_WWS_2012\Win32\Debug\"C:\RAD Studio\Projekte\backupTest\ctswws_Standard_2012-01-22_17-52.backup.sql"" kann nicht erstellt werden. Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch.
saying basically:the path or filename is wrong.
What adds the path of the .exe to the path of the backup file.
How can i get rid of it?

With best regards

Heinz Willi Dahmen

Posted: Mon 23 Jan 2012 11:33
by AlexP
Hello,

This problem occurs due to that you are use double quotes (") in the filename, and this error appears when calling the DelphiTFileStream.Create method. For resolving the problem, delete the double quotes from the filename.

Code: Select all

s:=txtBackupPath.Text + '\ + strBackupFile + '.sql';

Posted: Mon 23 Jan 2012 16:16
by hwd
:D Solved.
Thank you very much.

Posted: Tue 24 Jan 2012 06:33
by AlexP
Hello,

Glad to see that the problem was solved. If you have any other questions, feel free to contact us.