943,681 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 1457
  • C++ RSS
Jun 8th, 2008
0

Ado connection problem

Expand Post »
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
Last edited by lahom; Jun 8th, 2008 at 1:27 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
lahom is offline Offline
42 posts
since Apr 2008
Jun 8th, 2008
0

Re: Ado connection problem

Check in the generated msado15.tlh if it contains the ADODB namespace.
i.e. see can you find the following in it
C++ Syntax (Toggle Plain Text)
  1. #include <comdef.h>
  2.  
  3. namespace ADODB {
  4. ...

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

C++ Syntax (Toggle Plain Text)
  1. using namespace ADODB;
  2.  
  3. // or
  4.  
  5. ADODB::_ConnectionPtr m_pConn;

Which compiler are you using?
Reputation Points: 1105
Solved Threads: 389
Posting Virtuoso
mitrmkar is offline Offline
1,714 posts
since Nov 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: drag and drop api
Next Thread in C++ Forum Timeline: help with - Read csv into vector and display elements of vector.





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC