integer initialization messing up params

  • Thread starter Thread starter Dan Christie
  • Start date Start date
D

Dan Christie

I am using the standard microsoft data access help class
which contains a helper function for attaching parameters
to a command object. The function contains the following:

If p.Direction = ParameterDirection.InputOutput And
p.Value Is Nothing Then
p.Value = Nothing
End If

This works well for all of my data types except for
integers which initialize at zero. I'd like to keep the
value at null in the database if I don't supply a value. I
could test for zero on an integer data type and set the
value to nothing, but I may have some cases where zero is
the value the client sets. How are people doing this? I am
setting the parameter values using properties in the same
object.

Thanks,

Dan
 
Back
Top