Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello Everybody,
I'm using vb.net VS 2015 with MS Access 2013 as a database, My problem is occurring when i get my access database file with no data(i.e remove all the data from the fields in the database tables to start the application with no data).The error message appears (on click my save button) when i try to save my first record in the database and when i click my empty data grid view the same error also occur...
The error message says "object reference not set to an instance of an object".

What I have tried:

But when i return my old database file(filled with an old data)my application work in normal way without any error messages.............
Any suggestions would be appreciated
Thanks in advance
Posted
Updated 11-Aug-17 0:51am
Comments
Patrice T 10-Aug-17 19:13pm    
And you have some code with that error message ?
The error message should have come with the position of error.
amr aly 11-Aug-17 3:52am    
Thank you sir for your fast response.You solved my problem by saying"The error message should have come with the position of error." my problem solved because i remove try and catch code then the error become clear and when i changed my code my app work normally and i knew where the position of the error code.Many thanks sir
amr aly 11-Aug-17 4:25am    
But when i changed my code another problem appear but with no error. The code that i removed it i want using it in my app, i will try to solve this issue if i can't i'll return here to explain my new problem.The question is "Can i explain my new problem here or write another post?" thank you for all team in Code Project
Patrice T 11-Aug-17 6:41am    
Use Improve question to update your question.
So that everyone can pay attention to this information.

try to show code too.
amr aly 11-Aug-17 7:11am    
Thank you sir, I'll do so

1 solution

Quote:
How do i...save records in an empty access database file without any error message via VB.NET

This comment
'And you have some code with that error message ?
The error message should have come with the position of error.'
solved the question because it gave idea to remove the try/catch, letting VB spit a nice error message.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900