Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Need Help With ADO
Message
 
À
07/12/2001 16:05:44
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Divers
Thread ID:
00591211
Message ID:
00591495
Vues:
30
>>>>I have a method called ShowFieldValues on my form, which contains:
>>>>
>>>>
>>>> txtMi.Text = oRecSet.Fields("Mi").Value
>>>>

>>>>
>>>>and when I run it, I get the error"
>>>>
>>>>"Invalid use of null"
>>>>
>>>>Now I already know there is no data in this field, but that is ok in this
>>>>app. So how do I tell Access that Null's are ok?
>>>>
>>>>Thanks
>>>
>>>Try:
>>>
txtMi.Text = NZ(oRecSet.Fields("Mi").Value,"")
>>>
>>
>>
>>NZ comes from Oracle and is not recognize by VB. The shortest workaround is:
>>
txtMi.Text = oRecSet.Fields("Mi").Value & ""
>
>It may be that NZ is an Oracle function, but I suspect that Igor took it from the Access function NZ, which returns an empty string (by default) if the passed value is Null. In any case this wouldn't work on VB unless you code it yourself.

Hi,

NZ ia a part of VBA, I didn't know, that VB is missing it. Thanks for correction. I like Eric's solution. Very neat.

Thanks.
Igor Gelin
Database Developer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform