Unix Technical Forum

Accessing database through CRecordset

This is a discussion on Accessing database through CRecordset within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hi, In my VC++ 6.0 application, I have a database with 3 different tables say Client,Task, and Algorithm. I ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 09:54 PM
Ashish choudhari
 
Posts: n/a
Default 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.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 09:54 PM
Matt Neerincx [MSFT]
 
Posts: n/a
Default Re: Accessing database through CRecordset

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.googlegro ups.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.
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com