StrataFrame Forum

Help with Null Value

http://forum.strataframe.net/Topic20515.aspx

By Elio Reyes - 11/3/2008



Hi



I have to update a 3TH party database, I need to put a null value into field but the field is integer; the mayor problem is that this field has a constraint with other table... But I can't put a default value in the table, is no my.



The bold line shows how I'm trying to do.





With Me.Detalle_Produccion_Exactus1



If Not .Seek("orden_produccion = '" &

Me.Orden_Produccion1.ORDEN_PRODUCCION & "'" & _

" and FECHA_HORA_PRODUC = " & TicketProduccion1.FECTICK & "

AND " & _

" OPERACION = 'GALERA' ") Then

.NewRow()

.ORDEN_PRODUCCION = Me.Orden_Produccion1.ORDEN_PRODUCCION

.ARTICULO = Me.TicketProduccion1.ARTICULO

.OPERACION = "GALERA"

.LOCALIZACION = "ND"

.ESTADO = "N"

.CALIDAD = "P"

.LOTE = "ND"

.DET_PROD_LINEA = nLineaDetalleProduccion

.FECHA_HORA_PRODUC = TicketProduccion1.FECTICK

.BODEGA = "1037"

.CLIENTE = "01-02-00"

.LIQUIDACION = ""

.SERIE_CADENA = IIf(True, DBNull.Value, 0)

nLineaDetalleProduccion = nLineaDetalleProduccion + 1

End If





.CANTIDAD_PRODUCIDA = .CANTIDAD_PRODUCIDA + _

(TicketProduccion1.PRONETA - (TicketProduccion1.RECDIAC +

TicketProduccion1.RECDIAM)) / 1000

nTotalEncabezadoProduccion = nTotalEncabezadoProduccion + _

(TicketProduccion1.PRONETA - (TicketProduccion1.RECDIAC +

TicketProduccion1.RECDIAM)) / 1000

.Save()



End With



Thanks SF


By Greg McGuffey - 11/3/2008

I'm not sure I totally understand your problem, but assuming that Detalle_Produccion_Exactus1 is a BO and SERIE_CADENA is an integer property and you need to set a NULL in the db, you have two options:



1. set/return an alternate value for NULL

2. use a nullable type



Both options are setup for a BO within the BO mapper.
By Elio Reyes - 11/4/2008

Solved



Thanks a Lot
By Greg McGuffey - 11/4/2008

Glad you got it working! BigGrin