|
-
Aug 1st, 2000, 05:59 AM
#1
Thread Starter
Fanatic Member
Listed, I'm extracting data from a jet db, and I occasionally get crippling errors when a field is null. What's the best way of dealing with this - do I really need to put an "If not isnull(" thing in EVERY line, just in case?
-
Aug 1st, 2000, 06:11 AM
#2
Well ....
The best way, of course, is not to put any null values in your database 
I think using IsNull() is the only easy way out. Of course, you can do one thing: omit this validation for those fields which cannot be null. But otherwise, you don't have much option.
-
Aug 1st, 2000, 06:14 AM
#3
Thread Starter
Fanatic Member
-
Aug 1st, 2000, 06:18 AM
#4
Hyperactive Member
Yup.
If you can edit the database, remove all Null values and modify the design and give everything default values, that way you can never get a null anymore.
Or write a function which will give you the value of the database, or when it was null, a default value ("" for strings, 0 for numeric, etc)
But yeah it sucks....
-
Aug 1st, 2000, 06:43 AM
#5
Frenzied Member
If your errors are occuring because you are displaying the record data to a textbox (or simular)....
Do this:
Code:
Text1.Text = "" & rst!fieldname
-
Oct 29th, 2024, 10:25 AM
#6
New Member
Re: Jet DB's - dealing with Nulls
 Originally Posted by coox
Listed, I'm extracting data from a jet db, and I occasionally get crippling errors when a field is null. What's the best way of dealing with this - do I really need to put an "If not isnull(" thing in EVERY line, just in case?
You can write an application function that tests for nulls and returns a default value if need to deal with null data correctly. This will keep your code cleaner because you won't have to repeat the `If Not IsNull(...)` check on each line.
-
Oct 29th, 2024, 11:10 AM
#7
Re: Jet DB's - dealing with Nulls
hahaha, Halloween is definitely approaching ... old posts arising from the dead.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|