Ado connection problem

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2008
Posts: 42
Reputation: lahom is an unknown quantity at this point 
Solved Threads: 0
lahom lahom is offline Offline
Light Poster

Ado connection problem

 
0
  #1
Jun 8th, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 979
Reputation: mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice mitrmkar is just really nice 
Solved Threads: 209
mitrmkar mitrmkar is offline Offline
Posting Shark

Re: Ado connection problem

 
0
  #2
Jun 8th, 2008
Check in the generated msado15.tlh if it contains the ADODB namespace.
i.e. see can you find the following in it
  1. #include <comdef.h>
  2.  
  3. namespace ADODB {
  4. ...

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

  1. using namespace ADODB;
  2.  
  3. // or
  4.  
  5. ADODB::_ConnectionPtr m_pConn;

Which compiler are you using?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC