Null handling
-
I wounder how null values from a database can be handled in VB 6/ADO. Is it possible to pass a null value from a recordset to a VB parameter? When I try to pass a null value from a recordset to a VB parameter, it fails and the function is stopped. The parameter types are integer (mapping between datatypes is correct). Am I having a wrong (database-) perspective and try to handle null values in a way that you are not supposed to? Any enlightning response is welcomed!
-
I wounder how null values from a database can be handled in VB 6/ADO. Is it possible to pass a null value from a recordset to a VB parameter? When I try to pass a null value from a recordset to a VB parameter, it fails and the function is stopped. The parameter types are integer (mapping between datatypes is correct). Am I having a wrong (database-) perspective and try to handle null values in a way that you are not supposed to? Any enlightning response is welcomed!
The only variable type in VB 6 that can store a null is Variant. But Variant leads to bad programming, usually. You need to put an if before each strongly-typed use of a NULLable database field. That's why some people avoid NULLable fields like hell. "In an organization, each person rises to the level of his own incompetence." Peter's Principle
-
The only variable type in VB 6 that can store a null is Variant. But Variant leads to bad programming, usually. You need to put an if before each strongly-typed use of a NULLable database field. That's why some people avoid NULLable fields like hell. "In an organization, each person rises to the level of his own incompetence." Peter's Principle
-
I wounder how null values from a database can be handled in VB 6/ADO. Is it possible to pass a null value from a recordset to a VB parameter? When I try to pass a null value from a recordset to a VB parameter, it fails and the function is stopped. The parameter types are integer (mapping between datatypes is correct). Am I having a wrong (database-) perspective and try to handle null values in a way that you are not supposed to? Any enlightning response is welcomed!
Rulle wrote: I wounder how null values from a database can be handled in VB 6/ADO You can check the value of something being returned from the recordset with
isnull(adors("someField"))
. :) Nick Parker
**The goal of Computer Science is to build something that will last at least until we've finished building it. - Unknown
**