[patch_done] Blank rows with Delphi XE3 Starter

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
bootsector
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.09.2012, 11:24
Location: Campinas - SP
Contact:

[patch_done] Blank rows with Delphi XE3 Starter

Post by bootsector »

Hi guys!

After a long time without playing with Delphi, just bought my XE3 Starter copy and now I would like to use ZeosLib with it.

I managed to change codebase from https://zeoslib.svn.sourceforge.net/svn ... s/testing/ so it compiles fine under XE3 Starter.

However, I can't get data from the database! On a DBGrid, column names show up and the number of rows matches the number of rows in the table, but actual values are all blank!

Does anyone have an idea on what could be the issue?

Here's my modified package: http://www.sendspace.com/file/5ipolg

Any help would be appreciated!

Thanks!

bootsector
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

bootsector,

No idea what's wrong. XE3 is brand new so if we had:
just bought my XE3 Starter copy
then we could help. Don't know why you have blank rows now. Did they change the Buffer handling on the DataSets? .... You see: Really no idea. Maybe you have some findings?

After clicking all 10 Download Buttons(or are there more?) i found you shared file on sendspace.com. My issue is now that i'm not willing to compare each file against which revision? Can you generate a patchfile with TortoiseSVN?

Btw. switch to the new download section: http://svn.code.sf.net/p/zeoslib/code-0 ... es/testing
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
markus
Senior Boarder
Senior Boarder
Posts: 58
Joined: 17.10.2011, 12:43
Location: Piotrków Trybunalski, Poland

Post by markus »

Michael,
You can download 30 day trial of RadStudio XE3:
http://www.embarcadero.com/products/rad ... /downloads

Best regards,
Marek
bootsector
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.09.2012, 11:24
Location: Campinas - SP
Contact:

Post by bootsector »

Hey! Thanks for replying back!

So let me do this first: I will use the code from the repository you just pointed out. I'm assuming it has already the patch for supporting XE2, right?

Then I will generate diff files and post them (not on sendspace anymore lol).

Thanks,

bootsector
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

@bootsector,
I'm assuming it has already the patch for supporting XE2, right
That's right.


Proposals:
- If you need a new package then make a new one. Don't change something on the existing XE2 packages.
- If you need some code changes specially for XE3 then add some {$IFDEF} defines around to avoid breaking with older compilers and add a new define to the Zeos.inc.
Then I will generate diff files and post them
That would be nice!
(not on sendspace anymore
A good choise, i must admit i don't like such sites with xDownload buttons and this one you need is hidden for blind peoples like me, lol.

@markus,

thank you for that hint, Marek. If bootsector can't patch it then i'll have a look too. But i can't promisse anything..
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
bootsector
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.09.2012, 11:24
Location: Campinas - SP
Contact:

Post by bootsector »

@EgonHugeist,

Ok, first of all, pardon for my lack of knowledge on creating this "patch". My Delphi experience is pretty much limited to commercial applications, so I'd never had do dive into components source code and stuff!

Here's a link for the patch file: http://www.brunofreitas.com/sites/defau ... /patch.zip (yeah, I always forget that I have my very own host, so there's no point on using sendfile.com :P).

Main changes inside Zeos.inc:

Code: Select all

// Compilation directives for Delphi XE3
{$IFDEF VER240}
  {$DEFINE VER200BELOW} // Used in code
  {$DEFINE DELPHI12_UP} // Used in code
  {$DEFINE DELPHI14_UP} //Egonhugeist used in my code
  {$DEFINE DELPHI15_UP} // Used in zeos.inc only
  {$DEFINE DELPHI16_UP} // Used in code
  {$DEFINE DELPHI17_UP} // Used in code
  {$DEFINE BDS4_UP} // Used in code
  {$DEFINE BDS5_UP} // Used in code
  {$DEFINE D17_STARTER_EDITION}
{$ENDIF}
Where D17_STARTER_EDITION should be commented out if not Starter Edition.

I've defined it because of:

Code: Select all

{$IFDEF D17_STARTER_EDITION}
{$UNDEF WITH_IPROVIDERWIDE}
{$UNDEF BDS4_UP}
{$ENDIF}
However, that's probably NOT right, as I was just doing it blindly in order to make this thing build! I don't know if that would behave the same way on a non-Starter XE3 edition. This will need code review!

Anyways, I've used IFDEFS along the code to prevent breaking stuff for other Delphi versions.

With this patch, I got to the point where I could connect to a Firebird 2.1 database (actually examples/EMPLOYEE.FDB) and... the rest of the story is in the first post! :)

Hope I can get some help with this!

BTW, Love your avatar! Used to use it this very same one back then when I played BGII :D

Cheers,

bootsector
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

bootsector,

thanks for the files and patches! Nice workout! Patch done with all your defines (the ZVariant if unified in 1796 -> was safe for all compilers :lol: ).

Patch done R1794. So you can make a update again.

Question: What was wrong with the IProvider stuff? Which Exceptions did you get there
Actually i didn't download the trail because i had no time for this -> work overload. But i will do it if you do not find a clue to get it running.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
bootsector
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.09.2012, 11:24
Location: Campinas - SP
Contact:

Post by bootsector »

Hey! Thanks for commiting the stuff! :)

Here are the possible combinations and the errors thrown out during building...

Code: Select all

{.$UNDEF WITH_IPROVIDERWIDE}
{.$UNDEF BDS4_UP}
[dcc32 Error] ZAbstractRODataset.pas(392): E2137 Method 'PSGetTableNameW' not found in base class
[dcc32 Error] ZAbstractRODataset.pas(393): E2137 Method 'PSGetQuoteCharW' not found in base class
[dcc32 Error] ZAbstractRODataset.pas(394): E2137 Method 'PSGetKeyFieldsW' not found in base class
[dcc32 Error] ZAbstractRODataset.pas(395): E2037 Declaration of 'PSSetCommandText' differs from previous declaration
[dcc32 Error] ZAbstractRODataset.pas(398): E2137 Method 'PSExecuteStatement' not found in base class
[dcc32 Fatal Error] ZAbstractRODataset.pas(902): F2063 Could not compile used unit 'ZDatasetUtils.pas'

Code: Select all

{.$UNDEF WITH_IPROVIDERWIDE}
{$UNDEF BDS4_UP}
[dcc32 Error] ZAbstractRODataset.pas(392): E2137 Method 'PSGetTableNameW' not found in base class
[dcc32 Error] ZAbstractRODataset.pas(393): E2137 Method 'PSGetQuoteCharW' not found in base class
[dcc32 Error] ZAbstractRODataset.pas(394): E2137 Method 'PSGetKeyFieldsW' not found in base class
[dcc32 Error] ZAbstractRODataset.pas(395): E2037 Declaration of 'PSSetCommandText' differs from previous declaration
[dcc32 Error] ZAbstractRODataset.pas(398): E2137 Method 'PSExecuteStatement' not found in base class
[dcc32 Fatal Error] ZAbstractRODataset.pas(902): F2063 Could not compile used unit 'ZDatasetUtils.pas'

Code: Select all

{$UNDEF WITH_IPROVIDERWIDE}
{.$UNDEF BDS4_UP}
[dcc32 Warning] ZAbstractRODataset.pas(1258): W1000 Symbol 'GetFieldData' is deprecated: 'Use overloaded method instead'
[dcc32 Warning] ZAbstractRODataset.pas(1365): W1000 Symbol 'SetFieldData' is deprecated: 'Use overloaded method instead'
[dcc32 Warning] ZAbstractRODataset.pas(1402): W1000 Symbol 'Validate' is deprecated: 'Use overloaded method instead'
[dcc32 Warning] ZAbstractRODataset.pas(1785): W1000 Symbol 'GetFieldList' is deprecated: 'Use overloaded method instead'
[dcc32 Warning] ZAbstractRODataset.pas(2124): W1000 Symbol 'GetFieldList' is deprecated: 'Use overloaded method instead'
[dcc32 Error] ZStoredProcedure.pas(97): E2137 Method 'PSGetTableNameW' not found in base class
[dcc32 Warning] ZStoredProcedure.pas(284): W1000 Symbol 'SetBlobData' is deprecated: 'Use overloaded method instead'
[dcc32 Fatal Error] ZComponent.dpk(56): F2063 Could not compile used unit 'ZStoredProcedure.pas'
The .ico files are missing from the packages/DelphiXE3 folder. Patch didn't include them because they are binary... Maybe you would want to copy them from packages/DelphiXE2 folder?

I will download a XE3 Architect demo version later and see if the errors above will show up.

Cheers,

bootsector
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

bootsector,
Maybe you would want to copy them from packages/DelphiXE2 folder?
Yes this would be fine. You can zip them and attach them here too. Just click the preview button and you can attach files...

The blank rows solution,I think, you have allready posted now!

in XE3 is the zeos implemented procedure GetFielData() deprecated and does not fill any buffer:

Code: Select all

function GetFieldData(Field: TField; Buffer: TValueBuffer): Boolean; overload; virtual;
function GetFieldData(FieldNo: Integer; Buffer: TValueBuffer): Boolean; overload; virtual;
function GetFieldData(Field: TField; Buffer: TValueBuffer; NativeFormat: Boolean): Boolean; overload; virtual;
function GetFieldData(Field: TField; Buffer: Pointer): Boolean; overload; virtual; deprecated 'Use overloaded method instead';
function GetFieldData(FieldNo: Integer; Buffer: Pointer): Boolean; overload; virtual; deprecated 'Use overloaded method instead';
function GetFieldData(Field: TField; Buffer: Pointer; NativeFormat: Boolean): Boolean; overload; virtual; deprecated 'Use overloaded method instead';
Just have a look here: http://docwiki.embarcadero.com/Librarie ... tFieldData
call the deprecateds and do copy the Buffer: Pointer into the new type TValueBuffer(typedef System::DynamicArray<System::Byte> TValueBuffer;).

Then i think the case is closed and Zeos7 is prepared for XE3. Also can i see that undefining the overrides of IP PSGetTableNameW could be enough or only undefining WITH_IPROVIDER in the Zeos.Inc.

Anyway you have blank columns because now FieldBuffer is filled, bootsector. Until xe2 the deprecated function do this job.

What do you think, can you manage thes changes by your selves? And attach a patch again?

EDIT: i've uploaded you a patch with a WITH_TVALUEBUFFER define for XE3. It might be possible you will have compiling problems now. If this is true then it would be better to rewrite the function TZAbstractRODataset.GetFieldData(Field: TField;
Buffer: {$IFDEF WITH_TVALUEBUFFER}TValueBuffer{$ELSE}Pointer{$ENDIF}): Boolean;
function again and undefine the deprecated one. On the other hand could it be possible that you see now the values...

R1799
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
bootsector
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.09.2012, 11:24
Location: Campinas - SP
Contact:

Post by bootsector »

Thanks a lot, man!

I will give your patch a try and see how it goes!

After tests, I will upload a zip file with the missing icons for XE3 package and any necessary patch required in order to get this compiled.

TTYL

bootsector
bootsector
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.09.2012, 11:24
Location: Campinas - SP
Contact:

Post by bootsector »

EgonHugeist,

You've got it right! I can now see data in the DBGrid! :D

I had to make some changes though! I've attached a new patch (not sure about the typecasts, will need code review as usual) and the icons for the XE3 package!

Thanks a lot for your help!

bootsector
You do not have the required permissions to view the files attached to this post.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

bootsector,

nice to see it works now. Did you check, if data updateing/(SetFieldData() does work too?

Patch done 1801.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
bootsector
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.09.2012, 11:24
Location: Campinas - SP
Contact:

Post by bootsector »

Yeah, data updates seem to work fine as well! :)
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

bootsector,

thank you for your help. :up: What do you think, can we close this topic?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
bootsector
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 12.09.2012, 11:24
Location: Campinas - SP
Contact:

Post by bootsector »

Thank YOU for your support! :)

Yeah, go ahead and close this! Everything seems running smoothly now!

I will let you know if I have a different behavior on a non-Starter edition whenever I have the chance to test it.

Cheers,

bootsector
Locked