The plan was to update our project code to correct the 2019r2 errors, then I’d use r2 to test while others continued in r.1.1. When I was satisfied that r2 worked to expectation, we’d all switch.
That plan now seems DOA because of the changes to the PreparedSQLStatement interface (and maybe others). It requires that you implement SelectSQL(params) As RowSet
, but RowSet does not exist in r1.1 and there is no way for me to mark the method itself as r2-only.
Suggestions?
I find that if I wrap a bit of code inside
[code]#if TargetWin32
#endif[/code]
Then, even if it contains a syntax error, it compiles on a Mac build.
Maybe wrap old/new stuff inside
#if TargetLinux
or similar and change the line when you switch back and forth?
Except the offending part is the Return value. The interface in r2 demands I return a RowSet, but there is no “RowSet” in r.1.1.
Dang.
Can you return a variant?
Maybe have two methods, and use the trick to call ‘the right one’?
BTW, you can use the XojoVersion constant for what you describe.
#if XojoVersion >= 2019.02
// whatever
#endif
FYI, changing the return to variant, or eliminating it entirely, does not work.
Just had a conversation with @Greg O’Lone wherein he suggested a bit of a hack that I’m about to try. In the meantime, I’ll file a FR. It seems they could fix this, if they wanted, by just introducing a second interface that implements the first and adds the additional methods.
Can you not just use:
PreparedSQLStatement.SQLSelect(Paramarray bindValues() as Variant) As RecordSet
Instead? In each case SelectSQL returns a RecordSet and SQLSelect returns a RowSet.
[quote=458724:@Kem Tekinay]The plan was to update our project code to correct the 2019r2 errors, then I’d use r2 to test while others continued in r.1.1. When I was satisfied that r2 worked to expectation, we’d all switch.
That plan now seems DOA because of the changes to the PreparedSQLStatement interface (and maybe others). It requires that you implement SelectSQL(params) As RowSet
, but RowSet does not exist in r1.1 and there is no way for me to mark the method itself as r2-only.
Suggestions?[/quote]
custom subclasses that you use compat flags in 2019r2 and 2019r1 to turn you specific classes in use on and off
https://forum.xojo.com/conversation/post/449253
or just stick with Api 1.0 until you cant
[quote=458742:@Ian Kennedy]Can you not just use:
PreparedSQLStatement.SQLSelect(Paramarray bindValues() as Variant) As RecordSet
Instead? In each case SelectSQL returns a RecordSet and SQLSelect returns a RowSet.[/quote]
The interface in r2 demands I implement both.