Solved

CDaoRecordset to edit multiple tables

Posted on 1998-10-09
2
215 Views
Last Modified: 2013-11-20
I have an Access DB with 3 tables.  I used the ClassWizard to create a class derived from the base class of CDaoRecordset.  My goal is to write records to the three tables, however, within "CDaoRecordset::GetDefaultSQL()" , I am only allowed to define 1 table name to edit.  Hence, the only solution I can clearly see is to create 3 different CDaoRecordset classes and open and close the .mdb file each time I need to switch to a different table.  That way seems very inefficient.  Is it possible to access different tables within the same file and class?  How?  I am just starting to learn about databases, so any code would also be a big help.
0
Comment
Question by:halen
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
ID: 1323139
CDaoRecordset only works on one recordset.

You can't directly work on more than one table. However, if you can set up an editable view in your database, you can attach the recordset to that editable view and work against it. It can then cause edits to happen in as many underlying tables as you want.

Setting up an editable view is very dicey: you have to conform to lots of semantic rules, both for your database model and for the limitations of the underlying DMBS (which is Jet).

B ekiM
0
 

Author Comment

by:halen
ID: 1323140
You answered my question, thanks, however I don't know  what you you mean by "editable view"(remember I'm new to databases and CDao* classes).  Anyway, I was hoping for more guidance like I web site with an example or sample code.  By the way, I've used you book as reference for other things and think it's helpful.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Separate into files by filename 12 84
noX challenge 17 120
mapBully challenge 6 136
Problem to App 4 83
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: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

831 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