|
-
February 23rd, 1999, 05:45 AM
#1
How to handle empty fields in database....
Hi,
I'm using Recordset to retrieve data records from the database and place
them in a ListView.
The problem I'm facing now is that some of the fields in the recordset is
empty. When I tried to run my application, it just stop at the record which
has an empty field and returns "Invalid use of Null'.
I would like to know what I should do for the recordset to retrieve empty
fields from the database.
Thanks in advance
Angus Ching
-
February 23rd, 1999, 06:18 AM
#2
Re: How to handle empty fields in database....
Hi
This is covered in the Open FAQ in the CodeGuru/vb site - to fix your problem, simply append an empty string (ie. "") to the assignment,
e.g.
Text1.Text = oRecordSet.Fields("TestField") & ""
That way, any null value is converted to an empty string.
Look at then Open FAQ for more help
http://www.codeguru.com/vb/openfaq/open_faq.shtml
Regards
Chris Eastwood
-
February 23rd, 1999, 07:51 AM
#3
Re: How to handle empty fields in database....
Hello Angus,
the other way as that of Chris is that you check in your program, if a field is empty, with the function isnull.
if not isnull(Recordset!Field) then ... else ...
Greetings
Ting
-
April 21st, 2000, 11:41 AM
#4
Re: How to handle empty fields in database....
You could probably check with the ISnull Function when you are retriveing from the databse , branch off when it is Null
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
|