 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Michael Justin Guest
|
Posted: Wed May 02, 2007 8:54 pm Post subject: Delphi 2007 DBX4 TDBXError when empty resultset is read |
|
|
If the TSQLQuery result set is empty (Eof is True), accessing fields by
name fails with an TDBXError exception, as a workaround i have to check
for Eof before using any FieldByName('...').As... call.
In Delphi 7, in this situation reading the empty resultset returns
default (empty) values.
Should i add a QC entry for this with all details?
Michael Justin |
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Thu May 03, 2007 5:38 am Post subject: Re: Delphi 2007 DBX4 TDBXError when empty resultset is read |
|
|
Michael Justin wrote:
| Quote: | Should i add a QC entry for this with all details?
|
Yes.
--
Bill Todd (TeamB) |
|
| Back to top |
|
 |
Steve Shaughnessy Guest
|
Posted: Sat May 05, 2007 4:56 am Post subject: Re: Delphi 2007 DBX4 TDBXError when empty resultset is read |
|
|
This caused an AV in BDS2006.
We changed it to a TDBXError because we think it is invalid to attemp
accessing a value that does not exist.
Checking for Eof also provides more clarity in your code.
-Steve
"Michael Justin" <info (AT) betabeans (DOT) de> wrote in message
news:4638b44a (AT) newsgroups (DOT) borland.com...
| Quote: |
If the TSQLQuery result set is empty (Eof is True), accessing fields by
name fails with an TDBXError exception, as a workaround i have to check
for Eof before using any FieldByName('...').As... call.
In Delphi 7, in this situation reading the empty resultset returns default
(empty) values.
Should i add a QC entry for this with all details?
Michael Justin |
|
|
| Back to top |
|
 |
Dmitry Arefiev Guest
|
Posted: Sat May 05, 2007 8:11 am Post subject: Re: Delphi 2007 DBX4 TDBXError when empty resultset is read |
|
|
| Quote: | We changed it to a TDBXError because we think it is invalid to attemp
accessing a value that does not exist.
|
Yes, it is. But that may break a lot of code. Because long
time in Delphi and in many data access libraries field values
in empty dataset were Null's.
Regards,
Dmitry
--
Dmitry Arefiev - www.da-soft.com
AnyDAC - Oracle, MySQL, MSSQL, MSAccess, IBM DB2, Sybase
ASA, DbExpress, ODBC freeware data access framework |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|