[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Regarding MFC DataBase

Posted on 2000-02-02
1
Medium Priority
?
207 Views
Last Modified: 2013-11-20
I have created an MFC application.
Now I want to include the database in my application. I added an new Class
derived from CRecordset. I want to handle more than one table from the database. I am not clear whether I have to create the separate recordset for each table or in the same recordset I can have all the table?

2) How to execute a select SQL querry and how to get the data?

It will be helpful if u send some sample code. My mail-Id is sbala12@yahoo.com(Thank u)
0
Comment
Question by:sbala1mfc
1 Comment
 
LVL 4

Accepted Solution

by:
inpras earned 40 total points
ID: 2484768
>>I am not clear whether I have to create
>>                      the separate recordset for each table or in the same >>recordset I can have all the table?

U can do both but better have a seperate recordset derived for UR second table

now if U want to execute a query a select records

CDatabase db;
db.Open(....);

CRecordset rs(&db);
rs.Open(CRecordset::dynaset, "SELECT * FROM MyTab", none);
Sending a workspace for 25 points???

Hope this helps
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question