hi,
m developing an application using vb 2005 and MS Sql server 2005. At run time the application shows records being added but after closin the application when i view the table no updates have been made...
can u help me out..the same problem occured wid a teachers project i downloaded for reference which comes wid sql server 2005 sample download..the application(both of them) run widout error makin no permanent change in table...
Comments:
Dec 08, 2007
- how to perform commit using vb code for sql server 2005?
Generally database updates either require a commit to have the database perform the appropriate checking and actually flag the rows as part of the database. That Commit can occur in two ways -- some databases can be setup with an auto commit or auto rollback when the database is disconnected. The first means the programmer needs to do nothing. The second means if the programmer does not commit the updates are backed out of the database. To commit is generally considered bad because if there are any data errors partial transactions and logically inconsistent contents can exist in a database. For example entering an order for merchandise requires a single header row to identify the customer and multiple items rows to indicate what was ordered. If the third item record added to an order had an error and the application did not rollback and the database auto committed and incomplete order with only two items would be saved in the database. Traditionally databases with an automatic action at shutdown are set to rollback to assure such partial information is not saved. Even with auto rollback good programs detect errors and rollback themselves and allow users to continue.
The net result of the above is the probability that if the inserts actually occurred as you believe the there was a missing commit to confirm their addition to the database. and an automated rollback kept them from being completely added to the database. Another alternative is that the insert was not error checked in the program code and it failed meaning despite the program counter claiming rows were inserted in fact they were not.
Comments:
Dec 07, 2007
- Sorry error in the above
where it says "to commit is generally considered bad" it should read "to commit automatically is generally considered bad"
Dec 07, 2007
- Programmers generally should include commits and rollbacks as appropriate explicitly in their code.
Dec 08, 2007
- I am not a VB Coder but I can tell you Commit and Rollback are database calls similar to Insert, Update, Delete, Connect and Disconnect.
Microsoft (not exclusively) has several means of addressing database interface including (may be incomplete) ADODB, OLEDB and ODBC among others. A quick web search yielded several possible links however you will need to determine which, if either, is applicable to your environment.
Using photran 5.0 on eclipse (galileo) 3.5. I am having problems using large integers and reals in...
(More)
Using photran 5.0 on eclipse (galileo) 3.5. I am having problems using large integers and reals in calculations, at the moment i am only able to use up to 3E+47, but have no idea how to use larger numbers, i have read this is possible but dont know how to impliment.
How do you get around the problem of large Integers and Reals within photran eclipse? The maximum I...
(More)
How do you get around the problem of large Integers and Reals within photran eclipse? The maximum I can use is around 3E+47, I know it is possible to use larger but have no idea how to use larger numbers for calculations.
Got the Christmas edition r4 upgrade but can't get past the loading screen, not had this problem on...
(More)
Got the Christmas edition r4 upgrade but can't get past the loading screen, not had this problem on other upgrade cards