Sunday, March 25, 2012

Accessing database through CRecordset

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.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.
"Ashish choudhari" <ashishtchaudhari@.gmail.com> wrote in message
news:1126867931.595557.42760@.g47g2000cwa.googlegroups.com...
> 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.
>

No comments:

Post a Comment