SQLClasses modification?

This forum is meant for questions and discussions about the X# language and tools
Post Reply
kitz
Posts: 87
Joined: Wed Nov 29, 2017 8:56 am

SQLClasses modification?

Post by kitz »

Hello!
I am trying to convert a VO program to X#.
1.) In VO I have modified the SQL-Classes to not try to get a record count at SQLSelects and just close the selection but stay prepared if called again with same SQL-Statement but other parameters. (SQLString assignment).
I have done this by just inheriting the SQLSelect class and add own methods/assigns.
For X# how should that be done: Download the whole source of SQL-Classes and modify it? Or would it work with inheriting and additional methods/assigns?
2.) since VO28 there is an additional SQL-option set (while connecting?), which is about how many records are allocated, which is fixed set to 1.
This is in the SQLStatement class, which is called from the SQLSelect class. If I would like to remove this option setting (or make it changeable) I fear there is no other way but downloading the source and modify, because I can not influence SQLSelect to call a inherited class instead of SQLSelect. Or is there another way?
BR Kurt
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

SQLClasses modification?

Post by ic2 »

Hello Kurt,

Our strategy is that we try to find out how many different calls rely on the VO libraries. If it are not too many, we will try the .Net alternative which often offers more options and is maintained (which actually sometimes means something improves).

E.g. we are converting the last Internet SDK calls (FTP, cHttP) to Chilkat calls (a library we already use)

I would do the same for SQL classes I think.

Dick
kitz
Posts: 87
Joined: Wed Nov 29, 2017 8:56 am

SQLClasses modification?

Post by kitz »

Hello Dick,
as I use VO-GUI together with SQLSelect, it would be a major change to use .net SQL instead, which I have no time to spend for now.
For sure I will change this, but that is a long way...
BR Kurt
User avatar
robert
Posts: 4225
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

SQLClasses modification?

Post by robert »

Kurt,
I would start with trying to subclass the SQLSelect and SqlStatement classes.
Of course I do not know what you have changed, but a lot should be possible in a subclass.
And for 2) you can assign a new value to oStmt in the constructor of your subclass of SqlSelect, after you have called the constructor of the parent class. If you create a subclass of SqlStatement you can assign an instance of that class to oStmt.
This will result in an extra allocation of a Statement object, but that should not really hurt.
Make sure you destroy the existing oStmt object, so the allocated handles are freed as early as possible.


Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply