Solved

CDaoRecordset to edit multiple tables

Posted on 1998-10-09
2
221 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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 this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

691 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