hi
i created an application in vc++/MFC
now iam using ado to connect to the databaase
but there is aproblem i couldnot find any solution for it ....pleeease help
the problem is this error :
error C2146: syntax error : missing ';' before identifier 'm_pConn'
while iam defining : in stdafx.h
#import "C:\Program Files\Common Files\System\ADO\msado15.dll" \
no_namespace \
rename( "EOF", "adoEOF" )

and in the main class i define :
public:
_ConnectionPtr m_pConn;

i searched about this error and it all seemed about the # import
but i couldnot find any anything wrong about it
pleeease help me
its driving me crazy

Check in the generated msado15.tlh if it contains the ADODB namespace.
i.e. see can you find the following in it

#include <comdef.h>

namespace ADODB {
...

I guess it does, in which case you can use either

using namespace ADODB;

// or

ADODB::_ConnectionPtr m_pConn;

Which compiler are you using?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.