Groups | Blog | Home
all groups > sql server odbc > september 2005 >

sql server odbc : Accessing database through CRecordset


Ashish choudhari
9/16/2005 3:52:11 AM
Hi,
In my VC++ 6.0 application, I have a database with 3 different
tables say Client,Task, and Algorithm. I want to access this three
tables through CRecordset. As far as i know i need to derive three
different classes for each table, from CRecordset. Can anyone please
help me so that by deriving a single class from CRecordset I will be
able to access the three tables.
Matt Neerincx [MSFT]
9/18/2005 11:34:01 PM
You could always create a view in SQL Server that joins the three tables and
then use CRecordset over this view, this would be the easiest way to set
this up.

For example:

create view MyThreeTables as
select * from table1, table2, table3 where table1.id=table2.id and
table1.id=table3.id

The above SQL statement is oversimplified but it should help you get
started, you need to have some proper join condition setup for the tables to
work together.

--
Matt Neerincx [MSFT]

This posting is provided "AS IS", with no warranties, and confers no rights.

Please do not send email directly to this alias. This alias is for newsgroup
purposes only.

[quoted text, click to view]

AddThis Social Bookmark Button