Hi Guys,
I have some problem in adding records to the database table(ODBC).
After binding the controls to the recordset ,I dont know how to write the message handlers for add record.
Could u please help me by giving an example .
Thanks in advance
Printable View
Hi Guys,
I have some problem in adding records to the database table(ODBC).
After binding the controls to the recordset ,I dont know how to write the message handlers for add record.
Could u please help me by giving an example .
Thanks in advance
MFC ? no MFC ?
What do you mean by message handlers for add record ?
Its MFC.I referred MSDN.I could bind the control variables to recordset.
Then we need to write the implementation code in the respective handlers.
Suppose I have a button add and when i click on add ,then the editbox contents shld be added to the table. This is where i'm struck.
If you're using ODBC, I assume you're using a CRecordset derived class. If you aren't, you should be. The basic procedure there is call AddNew(), assign values to the member variables, then call Update().
As far as doing it in response to a button click, you'll need a message handler for your button. Again, assuming a CDialog derived class, use Class Wizard to assign a message handler for you.
For something like this I'll build an SQL statement in my button message handler then execute it with SQLExecute.Quote:
Originally Posted by poojanair