Solved

CDaoRecordset to edit multiple tables

Posted on 1998-10-09
2
208 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
Comment Utility
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
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

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…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now