?
Solved

CDaoRecordset to edit multiple tables

Posted on 1998-10-09
2
Medium Priority
?
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 200 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses
Course of the Month11 days, 10 hours left to enroll

752 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