Path Problem with PgDump.BackupToFile

Discussion of open issues, suggestions and bugs regarding PgDAC (PostgreSQL Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
hwd
Posts: 11
Joined: Sun 09 May 2010 17:27

Path Problem with PgDump.BackupToFile

Post by hwd » Sun 22 Jan 2012 17:11

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

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Mon 23 Jan 2012 11:33

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';

hwd
Posts: 11
Joined: Sun 09 May 2010 17:27

Post by hwd » Mon 23 Jan 2012 16:16

:D Solved.
Thank you very much.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 24 Jan 2012 06:33

Hello,

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

Post Reply