xsharp.eu • SQLClasses modification?
Page 1 of 1

SQLClasses modification?

Posted: Tue Nov 23, 2021 12:17 pm
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

SQLClasses modification?

Posted: Tue Nov 23, 2021 1:34 pm
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

SQLClasses modification?

Posted: Tue Nov 23, 2021 2:27 pm
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

SQLClasses modification?

Posted: Tue Nov 23, 2021 5:00 pm
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