I have XOJO 2023 R4 on macOS 14.4 .
I have two databases with an identical structure: an SQLite DB and an MSSQL DB.
When I work with the SQLite database and want to read a record that does not exist, my app does not run into the “for each…” loop.
If I am working with the MSSQL database and want to read a record that does not exist, my app runs into the “for each…” loop.
In both cases the RecordSet “dbRows” is not nil but there are only columns with nil values in dbRows.
Could this be an error in ODBCDatabase?
My Code: DB is the SQLiteDatabase and DBo ist the ODBCDatabase
try
if DBo = nil then
dbRows = DB.SelectSQL("select * from "+DB_Table_Kunde+" where Kundennummer = '"+iv_kunnr.ToString+"'")
else
dbRows = DBo.SelectSQL("select * from "+DB_Table_Kunde+" where Kundennummer = '"+iv_kunnr.ToString+"'")
end if
if dbRows <> nil then
gs_py_syst.subrc = 4
for each row as DatabaseRow in dbRows
PufferKunde.Kdnr = row.Column("Kundennummer").IntegerValue
PufferKunde.KundenID = row.Column("KundenID").StringValue
PufferKunde.ErzeugtAm = row.Column("ErzeugtAm").StringValue
PufferKunde.Name = row.Column("Name").StringValue
PufferKunde.Vorname = row.Column("Vorname").StringValue
17 posts - 5 participants