Xs2Ado AdoRecordSet:FieldGet() returns -1 for DbNull

This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
Post Reply
User avatar
elibrighton
Posts: 6
Joined: Wed Apr 05, 2017 11:15 pm

Xs2Ado AdoRecordSet:FieldGet() returns -1 for DbNull

Post 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?
Post Reply