Insert/Update statement
-
Hi, I have VB project with Access Database but when i use update statement with no errors but no changes occured in the database. connection string statement is "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=App_Data\TrainingDept.mdb" & _ ";Persist Security Info=True" why?
-
Hi, I have VB project with Access Database but when i use update statement with no errors but no changes occured in the database. connection string statement is "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=App_Data\TrainingDept.mdb" & _ ";Persist Security Info=True" why?
'where' clause correct?
-
'where' clause correct?
yes.Where clause is correct and when i wrote update statement on the access database, the data will be updated but the problem is the update statement in the vb code
-
Hi, I have VB project with Access Database but when i use update statement with no errors but no changes occured in the database. connection string statement is "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=App_Data\TrainingDept.mdb" & _ ";Persist Security Info=True" why?
What you posted looks ok, but its hard to tell just by that. The only thing i can offer with what you posted is if you are using 64 bit what you have won't work. ACE isn't supported in 64 bit. Post the entire statement or better yet look into TableAdapters.
-
Hi, I have VB project with Access Database but when i use update statement with no errors but no changes occured in the database. connection string statement is "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=App_Data\TrainingDept.mdb" & _ ";Persist Security Info=True" why?
If you have your Access database in your project, it is possible that every time you compile and run the app, the database being used (in the Debug folder or your project) is being overwritten by the master copy of the database in the project. Any changes you make during one run of your program will be lost the next time you run the app from Visual Studio. Now, if you're looking for changes that were supposed to have been made in one run of the application and you're not seeing them, the possible problems expand to either an incorrect WHERE clause in the SQL (it doesn't find the record(s) to change), or you're not looking at the correct copy of the database for the changes.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008
But no longer in 2009... -
Hi, I have VB project with Access Database but when i use update statement with no errors but no changes occured in the database. connection string statement is "Provider=Microsoft.ACE.OLEDB.12.0;" & _ "Data Source=App_Data\TrainingDept.mdb" & _ ";Persist Security Info=True" why?
-
Do a SELECT with your UPDATE statement's WHERE clause and you should see the reason why your table is not updated.
I like your answer.
-
I like your answer.