Win7中关于创建Ado Connect的情况 [英] What happens in Win7 about create Ado Connect

查看:132
本文介绍了Win7中关于创建Ado Connect的情况的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的程序,使用ado操作访问数据库,在winxp中运行非常好.
但是在胜利7中有一些沮丧的问题:

My Program,use ado operation access DB, run very good in winxp.
but in win 7 have some depressed problem:

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.

推荐答案

我怀疑您的平台是x64.我适合,无法使用64位以下的访问权限,因此您应该使用WOW64.
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.


完全相同,谢谢你,我解决了问题,HeHe
thank U all the same,I solve the problem, HeHe


这篇关于Win7中关于创建Ado Connect的情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆