0

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

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by mitrmkar
0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.