To use the update property you must set the correct cursortype and cursorlocation as well as locktype. Try this control featured on download.com that I have been using that has made my life easier:
http://download.com.com/3000-2404-10...ml?tag=lst-0-1
After selecting the CursorType, CursorLocation, LockType and Disconnected status of your Recordset (there are defaults). I bind my controls and that is it All the complexities of ADO are hidden from the user which is you.
Then I can Navigate, Add New, Delete, Refresh, Search and Save Changes to my recordsets without any other code. That is really it, no other code is needed.
This works in any environment
VB, Access, VC++ etc...
Let me know what you think.
Quote:
Originally posted by Thato
HI! Members
Please help! I need to get an amount from database, display it on a textbox and accept a number from the user. Subtract the user number from the amount in the textbox then put the answer back in that text box.
All that I have done, Now I need to save the new amount to the database and exit. My info is like this:
Database - MsAccess 2000
Name (Money) -- Table (Balances) -- Field (Curr_Bal)
I'm using ADO connection and I've tried putting the following code in the cmdSave button : 1. adBalances.fields("Curr_Bal")= text1.text
adBalances.Update
2. adBalances.recordset.update
I've tried these two seperately and I'm getting no response at all, I mean no errors. When I exit the program and run it again the amount from the database is still the same and I need the program to update the database everytime this transaction is perfomed.
Can someone please help.
|