Path Problem with PgDump.BackupToFile

Path Problem with PgDump.BackupToFile

Postby 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
hwd
 
Posts: 11
Joined: Sun 09 May 2010 17:27

Postby 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';
AlexP
Devart Team
 
Posts: 4067
Joined: Tue 10 Aug 2010 11:35

Postby hwd » Mon 23 Jan 2012 16:16

:D Solved.
Thank you very much.
hwd
 
Posts: 11
Joined: Sun 09 May 2010 17:27

Postby 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.
AlexP
Devart Team
 
Posts: 4067
Joined: Tue 10 Aug 2010 11:35


Return to PostgreSQL Data Access Components