Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Export Table Help
Wed, Jan 31 2007 2:28 AMPermanent Link

Sean in Kaz
DBISAM 4 Delphi 7 Pro

I am trying to export a table to a text file. I can do it in the Utilities but not in code. Any help appreciated...

In DBYSYS I have   EXPORT TABLE gprExport TO "c:\test.txt" DELIMITER ';' WITH HEADERS COLUMNS (RecordNum, Lattitude)

Works fine. Note: I need the semi-colon delimited for the next use of the file...

In Code I have:

tblGPRExport.Close;
qryExport.SQL.Clear;
With qryExport do begin
with SQL do begin
  add('EXPORT TABLE gprExport TO "c:\test.txt" DELIMITER ";" WITH HEADERS COLUMNS (RecordNum, Lattitude)');
end;
qryDelete.execsql
end;

It doesn't blow up, it just doesn't create the file. I have full permissions etc. etc.

Please help, Sean (Kazakhstan)
Wed, Jan 31 2007 4:43 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Sean

>tblGPRExport.Close;
>qryExport.SQL.Clear;
>With qryExport do begin
> with SQL do begin
> add('EXPORT TABLE gprExport TO "c:\test.txt" DELIMITER ";" WITH HEADERS COLUMNS (RecordNum, Lattitude)');
> end;
>qryDelete.execsql
>end;

You make have mistyped in the post but you're not running qryExport

Roy Lambert
Wed, Jan 31 2007 5:30 AMPermanent Link

Sean in Kaz
Hi Roy, yes, it was just a typo as I am working from laptop and had to retype it.  It apparently doesn't like my use of double-quotes around the semi-colon. It says,: Expected NULL , String expression but
instead found ";" in EXPORT TABLE SQL statement at line 1

Thank you, Sean
Sean in Kaz <Sean@HorizonCanada.com> wrote:

DBISAM 4 Delphi 7 Pro

I am trying to export a table to a text file. I can do it in the Utilities but not in code. Any help appreciated...

In DBYSYS I have   EXPORT TABLE gprExport TO "c:\test.txt" DELIMITER ';' WITH HEADERS COLUMNS (RecordNum, Lattitude)

Works fine. Note: I need the semi-colon delimited for the next use of the file...

In Code I have:

tblGPRExport.Close;
qryExport.SQL.Clear;
With qryExport do begin
with SQL do begin
  add('EXPORT TABLE gprExport TO "c:\test.txt" DELIMITER ";" WITH HEADERS COLUMNS (RecordNum, Lattitude)');
end;
qryDelete.execsql
end;

It doesn't blow up, it just doesn't create the file. I have full permissions etc. etc.

Please help, Sean (Kazakhstan)
Wed, Jan 31 2007 5:40 AMPermanent Link

Sean in Kaz
Hi Roy, it's been a while since I had to worry about this. I needed two single quotes on each side, instead a double quote on each side of the semi-colon. Thanks a lot...Sean



Sean in Kaz <Sean@HorizonCanada.com> wrote:

DBISAM 4 Delphi 7 Pro

I am trying to export a table to a text file. I can do it in the Utilities but not in code. Any help appreciated...

In DBYSYS I have   EXPORT TABLE gprExport TO "c:\test.txt" DELIMITER ';' WITH HEADERS COLUMNS (RecordNum, Lattitude)

Works fine. Note: I need the semi-colon delimited for the next use of the file...

In Code I have:

tblGPRExport.Close;
qryExport.SQL.Clear;
With qryExport do begin
with SQL do begin
  add('EXPORT TABLE gprExport TO "c:\test.txt" DELIMITER ";" WITH HEADERS COLUMNS (RecordNum, Lattitude)');
end;
qryDelete.execsql
end;

It doesn't blow up, it just doesn't create the file. I have full permissions etc. etc.

Please help, Sean (Kazakhstan)
Image