In VB6 there are at least four different types of nothing:
Nothing
, a null pointer as an objectvbNullString
, a null pointer as a stringEmpty
, an uninitialized variantNull
, a null value passed to / from a database
If you're passing the function into an ADO parameter, you need Null
, not Nothing
:
Function GetDbValue(ByVal tb)
If tb.Text = "" Then
GetDbValue = Null
Else
GetDbValue = tb.Text
End If
End Function