MySQL Data Null Handles With VB 6.0
If sometime you wite code in VB and you will find data into database that’s empty (read Null) and that’s maybe a big problem. Why you not insert some character to make the data field in data row sorted not null…? maybe you have some reason that make it cannot applicated into data storage. You can try solution with ISNULL() Function.
Syntax:
IsNull(expression)
Return Data type:
Boolean
Example:
If IsNull(RsData!telp_asal) = True Then
Text1(4).Text = ""
Text1(5).Text = ""
Else
Text1(4).Text = Mid(RsData!telp_asal, 1, InStr(RsData!telp_asal, "-") - 1)
Text1(5).Text = Mid(RsData!telp_asal, 1, InStr(RsData!telp_asal, "-") + 1)
End If
That’s it…. simple methode to handle null data from database.