Link to home
Start Free TrialLog in
Avatar of marco53
marco53

asked on

#import ADO\msado15.dll compiler error

In my Visual. c++ application (.net) I am trying to manage a database with the ADO control.
In the .h file I have:
#define INITGUID
#import "c:\Program Files\Common Files\System\ADO\msado15.dll"
                  rename_namespace("ADOCG") rename ("EOF","EndOfFile")
using namespace ADOCG;
#include "icrsint.h"

class CCustomRs :
      public CADORecordBinding
{
public:
};

class CCustomRs :
      public CADORecordBinding
{
public:
};
And when I compile the projecte (dialog based), I get these error:
....MyApp\Debug\msado15.tlh(2374) : error C2059: syntax error : '-'
....MyAppDebug\msado15.tlh(2374) : error C2238: unexpected token(s) preceding ';'
....MyApp\CustomRs.h(3) : error C2501: 'rename_namespace' : missing storage-class or type specifiers

Can help, please?
Marco53
Avatar of flavo
flavo
Flag of Australia image

If you are using .Net, why not use the oledb class?
Avatar of marco53
marco53

ASKER

I am following a book "Visual C++ .NET " - Davis Chapman from Apogeo, and try to learning Visual C++.
What is the difference between ADO and oledb class?
Can I add and delete records from database?
Thanks
Sure can.

If you are learning C++, have you considered C#??

In any case, i beleive all .Net languages can use the .net framework classes.. I must say i cant use C++ (bit of C# and compitent in dataAccess with VB .Net), ill see what i can do

Dave
ASKER CERTIFIED SOLUTION
Avatar of flavo
flavo
Flag of Australia image

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 marco53

ASKER

I am an Assembler programmer!! Since few months I am facing VC.NET.Its very hard to enter in this world. But I need for my job!!
Thanks for help
Just google MSDN for C++ oledbCommand and you'll find your feet :)

Good Luck!

Dave