BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Delphi 2007 DBX4 TDBXError when empty resultset is read

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress)
View previous topic :: View next topic  
Author Message
Michael Justin
Guest





PostPosted: Wed May 02, 2007 8:54 pm    Post subject: Delphi 2007 DBX4 TDBXError when empty resultset is read Reply with 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
Bill Todd
Guest





PostPosted: Thu May 03, 2007 5:38 am    Post subject: Re: Delphi 2007 DBX4 TDBXError when empty resultset is read Reply with quote



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





PostPosted: Sat May 05, 2007 4:56 am    Post subject: Re: Delphi 2007 DBX4 TDBXError when empty resultset is read Reply with quote



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





PostPosted: Sat May 05, 2007 8:11 am    Post subject: Re: Delphi 2007 DBX4 TDBXError when empty resultset is read Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (dbExpress) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.