Link to home
Start Free TrialLog in
Avatar of majorjohn
majorjohn

asked on

SQL Server Database Connectivity with MFC

Hi everybody,

My question is in relation with the connectivity
with SQL Server Database. I want to connect my SQL
Server database with my MFC Application. I am able
to connect Access database smoothly but what is to
be done for SQL Server.

Please see the followings :

1) My project is a SDI application.
2) I have chosen "Header Files Only" in AppWizard
   Database Support screen.
3) I am not deriving any class from CDatabase. Only
   in OnNewDocument() of Document class I am defining
   an object of CDatabase.
4) I am deriving table specific class from CRecordset
   and in OnNewDocument() associating this with above
   CDatabse Class.
5) Ultimately I am using the CRecordset class in my
   Dialog taking the ptr of CRecordset class.

Considering the above please give me solution with
suitable example.

Thanks,
ASKER CERTIFIED SOLUTION
Avatar of anoops
anoops

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of majorjohn
majorjohn

ASKER

anoops

With ur answer I had to do some extra R&D and achieved the result. Anyway U answered me in right time. Can u leave ur email address. So in any future problem I can contact u directly.

Thanks
Yup..with pleasure..:)) use..

anoops@hiso.honeywell.com
or
anoop_sreedhar@hotmail.com