Click here to Skip to main content
15,887,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My Program,use ado operation access DB, run very good in winxp.
but in win 7 have some depressed problem:
C#
CAdoConnection::CAdoConnection()
{
//创建 Connection 对象---------------------------
m_pConnection.CreateInstance("ADODB.Connection");


it will suspend in m_pConnection.CreateInstance("ADODB.Connection"); 

specific Description:

  // Loads an interface for the provided CLSID.
  // Returns an HRESULT. Any previous interface is unconditionally released.
  //
  HRESULT CreateInstance(const CLSID& rclsid, IUnknown* pOuter = NULL, DWORD dwClsContext = CLSCTX_ALL) throw()
  {
  HRESULT hr;

  _Release();

  if (dwClsContext & (CLSCTX_LOCAL_SERVER | CLSCTX_REMOTE_SERVER)) {
  IUnknown* pIUnknown;
  hr = CoCreateInstance(rclsid, pOuter, dwClsContext, __uuidof(IUnknown), reinterpret_cast<void**>(&pIUnknown));


hang-up in hr = CoCreateInstance(rclsid, pOuter, dwClsContext, __uuidof(IUnknown), reinterpret_cast<void**>(&pIUnknown));


can not return any Error code;
please help me.
Posted
Updated 7-Jul-10 2:00am
v2

I suspect that your platform is x64.I fit is there's no way to to use access under 64 bits so you are supposed to use WOW64.
 
Share this answer
 
thank U all the same,I solve the problem, HeHe
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900