Board index » delphi » How to check ClientDataset.savetofile successs?
Pitak Tang
Delphi Developer |
Pitak Tang
Delphi Developer |
How to check ClientDataset.savetofile successs?2003-10-29 11:48:30 AM delphi67 Hello, I like to save data in Clientdataset to disk, but that disk space is not enough to hold all data. How can I know Clientdataset.savetofile (filename) is not success ? Thank you. Pitak |
Gbenga A{*word*73}la
Delphi Developer |
2003-11-01 04:00:06 AM
Re:How to check ClientDataset.savetofile successs?
You can use the exception handling block like this:
begin try ....your code here. except on e:exception do begin ShowMessage(e.Message) //you can further add your own message here like //or add the message to the above one //ShowMessage(e.Message + ' ...Something is wrong'); ShowMessage('Something is wrong here...") end; end; //end try end; ============= end of Message ======== "Pitak Tang" <XXXX@XXXXX.COM>writes: QuoteHello, |
Pitak Tang
Delphi Developer |
2003-11-01 12:00:32 PM
Re:How to check ClientDataset.savetofile successs?
I have try that but no luck.
It never exception. "Gbenga A{*word*73}la" <XXXX@XXXXX.COM>writes Quote
|
Ignacio Vazquez
Delphi Developer |
2003-11-01 12:04:23 PM
Re:How to check ClientDataset.savetofile successs?
Hello, Pitak!
You wrote on Sat, 1 Nov 2003 11:00:32 +0700: QuoteI have try that but no luck. Ignacio |
Pitak Tang
Delphi Developer |
2003-11-01 12:37:07 PM
Re:How to check ClientDataset.savetofile successs?
Hi Ignacio,
This is my code. Try Clientdataset1.savetofile ('a:\abc.cds'); Except On E : Exception do.... end; I expect it should be failed when A: has not enough space. Regards, Pitak "Ignacio Vazquez" <ivazquezATorioncommunications.com>writes QuoteHello, Pitak! |
Ignacio Vazquez
Delphi Developer |
2003-11-01 12:38:09 PM
Re:How to check ClientDataset.savetofile successs?
Hello, Pitak!
You wrote on Sat, 1 Nov 2003 11:37:07 +0700: QuoteI expect it should be failed when A: has not enough space. Ignacio |
Pitak Tang
Delphi Developer |
2003-11-01 02:28:23 PM
Re:How to check ClientDataset.savetofile successs?
Yes, I do so many times.
It will create file on A:, but file size is zero. I have test with W2K SP 4, and XP SP 1. Result are same. My Delphi version 6 Ent SP 2. Regards, Pitak "Ignacio Vazquez" <ivazquezATorioncommunications.com>writes QuoteHello, Pitak! |