|
-
October 5th, 2005, 06:32 PM
#1
Database connectivity
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
-
October 5th, 2005, 07:03 PM
#2
Re: Database connectivity
MFC ? no MFC ?
What do you mean by message handlers for add record ?
-
October 5th, 2005, 09:04 PM
#3
Re: Database connectivity
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.
-
October 6th, 2005, 07:11 AM
#4
Re: Database connectivity
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.
-
October 6th, 2005, 09:43 AM
#5
Re: Database connectivity
 Originally Posted by poojanair
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
For something like this I'll build an SQL statement in my button message handler then execute it with SQLExecute.
I know how to build. What to build is a completely different story.
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
|