TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by CristianP » Mon 29 Apr 2013 16:24

Hello,

XE4 with UniDAC 5.0.1 with SQLite connection.

I try to start my application in iOS Simulator.
I have connected with ForceCreateDatabase and created all my tables but when I try to open first table with TUniQuery I have an EConvertError in TCustomLiteDataSetService.GetRecordCount() StrToInt().
I have UniDAC with sources and would like to see sources but you changed password for ZIP file, so I can't. My developer license number is 01811.

Best Regards,
Cristian Peta

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by AlexP » Tue 30 Apr 2013 10:53

Hello,

We couldn't reproduce the problem, please send a small test application (the sources) demonstrating the problem to alexp*devart*com.
Please contact our sales*devart*com to get the new password for the sources.

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by CristianP » Tue 30 Apr 2013 12:43

Hello,

I have send an email to sales* yesterday before starting this topic. I will wait...
I tried to make a test project but I can't reproduce so I prefer to debug myself before to try more with test project.

Best Regards,
Cristian Peta

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by CristianP » Tue 30 Apr 2013 16:18

Hello,

I received the sources and I found that if I check UniQuery1.Options.QueryRecCount I can reproduce the error in iOS Simulator and Device but not in Win32.
If you still can't reproduce please tell me so I will send you an test project.

Best Regards,
Cristian Peta

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by CristianP » Thu 02 May 2013 09:25

Hello,

I've send an email to you with two projects. One is for iOS and other for Win32 but I think is related to what is happening in iOS.

Best Regards,
Cristian Peta

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by AlexP » Tue 07 May 2013 14:40

Hello,

Thank you, we have received your sample and reproduced the problem. We will inform you as soon as we have any results.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by AlexP » Wed 08 May 2013 08:12

Hello,

We have fixed the problem on the iOS simulator and a real device, this fix will be included to the next build. The error, that occurs on our sample on a win platform, is correct, since the field value is NULL and there is no such field in the table, therefore SQLite returns the type of such field as TEXT. To solve the problem, you can use the IFNULL method for conversion of the null value to 0, i.e.:

Code: Select all

IFNULL(LENGTH(B.Fisier),0)

CristianP
Posts: 79
Joined: Fri 07 Dec 2012 07:44
Location: Timișoara, Romania

Re: TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by CristianP » Wed 08 May 2013 12:47

AlexP wrote:To solve the problem, you can use the IFNULL method for conversion of the null value to 0
Thank you, I used COALESCE because is similar and compatible with all servers I use.

Best Regards,
Cristian Peta

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: TCustomLiteDataSetService.GetRecordCount() StrToInt() EConvertError

Post by AlexP » Wed 08 May 2013 14:43

Hello,

Yes, you are right, using COALESCE is one of solutions for this problem.

Post Reply