|
-
Mar 29th, 2017, 09:44 AM
#1
Thread Starter
Junior Member
VB .net and Microsoft Access - NULL ISSUE
Hi Everyone! I'm stumped and need some assistance please.
I created an inventory system in VB.net that talks to Microsoft Access. The Access setup is fairly simple - 4 tables. The VB application can query the database, display data in textboxes, update fields in the database, or delete entire records.
Everything worked fine until I had to add a field in one of the tables to accommodate item ownership. I added the field, and then things started acting strange in the VB app. Only half of the text boxes would populate when the database was queried.
Long story short, the problem ended up being null values in the database. Adding the new database field screwed up the database somehow. I'm not sure I am wrapping my head around this correctly, but when I was initially populating the database through the app and saving data records, empty fields in the VB app were saved in the database in a particular format.... yet adding a new field in the database contains data of a different format (or lack of a format... i.e. null). When my program hits a null in the database, it sort of breaks, and cannot continue past the field that contains a null.
My question is, HOW DO I HANDLE NULLS IN THE DATABASE?????? Can I replace nulls in the database with some other empty value through a SQL query?? I have tried to go in and manually add a " " (a space) and save the database, but it doesn't save the empty space in the fields. Same problem exists.
I have done lots of google searches, and have identified that this is indeed an issue, but there seems to be no viable resolutions from the database end.
It is not practical to re-inventory 1000 parts, now that the new field is added. Further, I can see that down the road we will have to add another field or two. It cannot be the case that I will have to re-inventory everything over and over every time I add a new database field to remedy the null issue.
Can anyone help me please???
Just an FYI - I am NOT an expert programmer, so if you provide a suggestion do you think you could contribute the code or SQL statement to try out on my end? I'd appreciate it!!!!
-Dave
Tags for this Thread
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
|