-
October 18th, 2012, 01:46 AM
#1
Update a record with ADOTABLE
Goodmorning
I have a simpe application with 2 tables in a database in access 2007
If i use an ADOTable and i want not to post a new record but to change one that already exist. How i move to the row to change my record. for example i wrote that but its not right because no changes become
ADOTable1->Active=true;
ADOTable1->Edit();
ADOTable1->FieldValues["CUSTOMER_WATERMETER"]=Edit3->Text;
ADOTable1->FieldValues["CUSTOMER_NAMED"]=Edit4->Text;
ADOTable1->FieldValues["CUSTOMER_SURNAMED"]=Edit5->Text;
ADOTable1->FieldValues["CUSTOMER_FATHERD"]=Edit6->Text;
ADOTable1->FieldValues["CUSTOMER_STATHEROD"]=Edit7->Text;
ADOTable1->FieldValues["CUSTOMER_MOBILED"]=Edit8->Text;
ADOTable1->FieldValues["CUSTOMER_AFMD"]=Edit9->Text;
ADOTable1->FieldValues["CUSTOMER_ADDRESSD"]=Edit10->Text;
ADOTable1->FieldValues["CUSTOMER_CITYD"]=Edit11->Text;
ADOTable1->FieldValues["CUSTOMER_ZIPD"]=Edit12->Text;
ADOTable1->Post();
ADOTable1->Active=false;
I am not sure if Edit is the right code to move on the row that i want to make the change. For example if i want a new one i would use Append and go to a new row. should i use an other component?
-
October 18th, 2012, 02:52 AM
#2
Re: Update a record with ADOTABLE
Did you open the recorsdset before updating it?
And, please, use Code tags while posting code snippets! See Announcement: Before you post....
Victor Nijegorodov
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
|