Nice... I don't know why I didn't think of this. I guess it's time to put a request for Null as an item you can get from dbgetprop()... My other thought was to open the DBC as a table, find the record for the field and see what the allownull field was set for. Of course your solution works for cursors also.
Although, I solved it by looking at the DBCx meta data which does expose this value as a property.
BOb
>Hi Bob.
>
>
Does anyone know how to determine if a field in a view (or any field for that matter) allows nulls? There is no DBGetProp() for this, which surprises me a bit.>
>How about this (off the top of my head and untested):
>
>
>FUNCTION DoesFieldAllowNulls( tcField, tcAlias )
>LOCAL lnFields, lnRow, llAllowsNull, laFields[ 1 ]
>
>lnFields = AFIELDS( laFields, tcAlias )
>lnRow = ASCAN( laFields, tcField, 1, -1, 1, 15 )
>IF lnRow > 0
> llAllowsNull = laFields[ lnRow, 5 ]
>ENDIF
>
>RETURN llAllowsNull
>
Nice... I don't know why I didn't think of this. I guess it's time to put a request for Null as an item you can get from dbgetprop()... My other thought was to open the DBC as a table, find the record for the field and see what the allownull field was set for.
BOb