xsharp.eu • Xs2Ado AdoRecordSet:FieldGet() returns -1 for DbNull
Page 1 of 1

Xs2Ado AdoRecordSet:FieldGet() returns -1 for DbNull

Posted: Tue Sep 28, 2021 6:42 am
by elibrighton
Hi,
I'm using version 5.0.4.0 of Xs2Ado in an XSharp project using the Vulcan dialect. I've noticed that the AdoRecordSet:FieldGet() method returns a -1 (Long) value for DbNull values when the AdoCommand:CommandType is set to adCmdStoredProc. Hopefully my use of DbNull is correct here.

Code: Select all

LOCAL oCommand AS AdoCommand
LOCAL oRs AS AdoRecordSet
...
oCommand := AdoCommand{}
oCommand:CommandType := adCmdStoredProc
...
oRs := oCommand:Execute(NIL, System.Reflection.Missing.Value, NIL)
uSomeVar := oRs:FIELDGET(#SomeColumn)

// uSomeVar is -1 (Long) when the column value is a DbNull
However, this same code returned a NULL (NIL) for Text columns and a 0 for Int columns with DbNull values when using Vulcan.NET.

Could you please help me understand if this is the expected behaviour in Xs2Ado for the ADORecordSet class?