So I have Xojo up and running on Windows Server and as per some of the discussion above, the native SqlServer plugin just seems more trouble than it’s worth. Began by whining about the native client not being installed, when in fact Sql Server developer edition in its entirety is directly on that box. I perused TOF and found people talking about installing old versions of the native client and I said, feh, let’s just try ODBC instead.
After some futzing with the the system DSN (Xojo was opening the master DB despite me setting the desired Db property in the OdbcDatabase class; I had to select that at the system DSN level) I now have a query that should return several thousand rows, only returning the first row. There is no TOP n clause, there is no WHERE clause, it’s equivalent to SELECT * FROM TableName, and from SSMS I can see nearly 6K records in that table.
Per TOF, this “only returns one row” issue was happening to some poor soul back in 2019. In his case he was using “prepared statements”, which I’m not. Getting away from prepared statements solved his issue.
The same query works on MacOS when I run the app there, but that’s talking to Postgres. I had to tweak all the queries for sql server, mostly because of differences in how the new PK is returned from an INSERT, differences in how fields are quoted, etc. But Sql Server is something I have WAY more experience with than Postgres so I did not anticipate this sort of weirdness.
100% of the SQL is written by yours truly, so I don’t have any issues with some black box routine generating weird SQL behind my back.
ETA: switching to a different tab control pulling from a different table, all the rows are returned, but in about 17 seconds rather than the 1-2 seconds in the Mac version [sigh]. Anyway this isn’t a general problem where every query returns 1 row. There are other queries populating drop-downs and so forth all working correctly. There’s a more complex query that also is wrongly returning one row (that I’ve noticed).
I’m not seeing any similarities between the offending queries, which are:
SELECT UpperCaseName AS [Upper Case],MixedCaseName As [Mixed Case], LastUpdate AS Updated,Remarks FROM SpecialCapitalization WITH (NOLOCK)
SELECT * FROM Country WITH (NOLOCK) ORDER BY CASE WHEN CountryName = 'United States' THEN '1' WHEN CountryName = 'Canada' THEN '2' WHEN CountryName = 'Mexico' THEN '3' ELSE CountryName END
Both queries work perfectly from SSMS.