Hello friends,
Until now, I’ve been using this method call to select records from a database (RealBasic 2010), but with Xojo 2025, this relatively simple function is returning an empty RecordSet, if I have tested and understood correctly.
Function SQL_SELECT(ByVal RsRef As RecordSet, ByVal SQL As String, OBJ As Object = Nil) As Boolean
Has something changed in the meantime? ByVal?
SQL_Select is a now built in method.
I can’t find that in the docs, plus it’s supposed to be that if you implement something with the name of a framework function that your function gets called because of scope.
Sorry. No underscore. Ignore me.
Seems to me that in this context RsRef must be passed byRef, not byVal…
Passing byVal -that is the default- means that RsRef keeps its value only inside the method, without affect the RsRef value in the caller.
Tim,
I’m not sure I fully understood what you were saying, but my function doesn’t share the same name as the one in the framework (SQLSELECT vs. SQL_SELECT). Of course, there are workarounds, but I wanted to understand the issue and avoid having to fix hundreds of calls to this kind of functions.
Xavier,
I tried passing the RecordSet by ByRef, but Xojo rejects it, even at the encoding stage, unless there’s a way to force it.
in a lot of my methods, i pass the recordset as parameter without any byref or byval and it works fine.
I was trying to politely mention to Ian that I don’t think his suggestion is the problem.
The reference to being ignored was about myself, not Ian.
And I agreed, I said to ignore what I said. Apologies.
(I was trying to clarify for Benoît, you and I are on the same page!)
Yes, no problem. My comment was more aimed at him than you ![]()
objects are always byref
if you change to api 2 it would be rowset
and there was a change from lasterror to try catch