Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

CDaoRecordset to edit multiple tables

Posted on 1998-10-09
2
Medium Priority
?
225 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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

618 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