vc 连接数据库CreateInstance失败问题
2014-01-09 15:07
351 查看
下面是在微软MSDN官网查到的类似问题的答疑,具体网址如下
http://social.msdn.microsoft.com/Forums/vstudio/en-US/701d05aa-e8d2-4f46-8cc1-448a8d35bd37/windows-7-sp1-ado-compatibility
内容:
Windows 7 SP1 ADO Compatibility
Visual Studio Languages forums > Visual C++
Question
0
Sign in to vote
Hi:
I am a little confused, the same code compiled on different platforms(Windows 7,Windows 7 SP1 ,Windows XP SP3) have different results with VC2010 professional
_ConnectionPtr m_pConn;
m_pConn.CreateInstance(__uuidof(Connection));
compiled on Windows 7 or Windows XP SP3 , normal work.But complied on Windows 7 SP1,only run Windows 7 SP1,doesn't work on other computers without Win7 SP1, after m_pConn.CreateInstance(__uuidof(Connection)),result :m_pConn == NULL!
Monday, February 28, 2011 6:32 AM
Reply | Quote |
default20110 Points
Answers
0
Sign in to vote
Hi:
This is Windows 7 32bit! Install SP1 ,msado15.dll version:6.1.7601.17514. old version :6.1.7600.16385 of without SP1!
KB983264 contain : Msado15.dll 6.1.7600.20701 !
SO, If ADO program compiled on Windows 7 SP1 ,your ADO program can work on a computer with KB983246 or install Windows 7 SP1!
OK,Thanks !
Wednesday, March 02, 2011 3:11 AM
Reply | Quote |
default20110 Points
All replies
0
Sign in to vote
Explain what "doesn't work" means.
m_pConn.CreateInstance() returns an HRESULT if it fails. What is its value?
Monday, February 28, 2011 4:57 PM
Reply | Quote |
Brian Muth (MCC, MVP) 49,380 Points
0
Sign in to vote
Hi:
Becuse I compiled on Windows 7 SP1,application only work the computer with Windows 7 SP1!or else m_pConn.CreateInstance() failed! HRESULT value: -2147467262
Tuesday, March 01, 2011 1:32 AM
Reply | Quote |
default20110 Points
0
Sign in to vote
i think first of all you check whether your windows 7 is 64 bit or 32 bit. if it is 64 bit and you have 64 bit driver used for database access i.e(check paths from program files or Program files(x86) it should be program files(x86) for 32 bit application on windows 7 64 bit). it is also worth checking whether you have proper version of drivers for ADO for 32 bit if your application is 32 bit and 64 bit if your application is 64 bit. By default Windows7 only install one of them depend on windows version at a time.
Fahd Anwar
Tuesday, March 01, 2011 10:54 AM
Reply | Quote |
Fahd Anwar فہد انورElixir Technologies Paki...315 Points
0
Sign in to vote
Hi:
Becuse I compiled on Windows 7 SP1,application only work the computer with Windows 7 SP1!or else m_pConn.CreateInstance() failed! HRESULT value: -2147467262
That value is 0x80004002, which is "No such interface is supported". There is something odd here. I'm wondering if you are using the #import directive on a version of ADO which is not available on earlier versions of the operating system.
Tuesday, March 01, 2011 5:04 PM
Reply | Quote |
Brian Muth (MCC, MVP) 49,380 Points
0
Sign in to vote
Hi:
This is Windows 7 32bit! Install SP1 ,msado15.dll version:6.1.7601.17514. old version :6.1.7600.16385 of without SP1!
KB983264 contain : Msado15.dll 6.1.7600.20701 !
SO, If ADO program compiled on Windows 7 SP1 ,your ADO program can work on a computer with KB983246 or install Windows 7 SP1!
希望能给碰到类似问题的有点作用!
http://social.msdn.microsoft.com/Forums/vstudio/en-US/701d05aa-e8d2-4f46-8cc1-448a8d35bd37/windows-7-sp1-ado-compatibility
内容:
Windows 7 SP1 ADO Compatibility
Visual Studio Languages forums > Visual C++
Question
0
Sign in to vote
Hi:
I am a little confused, the same code compiled on different platforms(Windows 7,Windows 7 SP1 ,Windows XP SP3) have different results with VC2010 professional
_ConnectionPtr m_pConn;
m_pConn.CreateInstance(__uuidof(Connection));
compiled on Windows 7 or Windows XP SP3 , normal work.But complied on Windows 7 SP1,only run Windows 7 SP1,doesn't work on other computers without Win7 SP1, after m_pConn.CreateInstance(__uuidof(Connection)),result :m_pConn == NULL!
Monday, February 28, 2011 6:32 AM
Reply | Quote |
default20110 Points
Answers
0
Sign in to vote
Hi:
This is Windows 7 32bit! Install SP1 ,msado15.dll version:6.1.7601.17514. old version :6.1.7600.16385 of without SP1!
KB983264 contain : Msado15.dll 6.1.7600.20701 !
SO, If ADO program compiled on Windows 7 SP1 ,your ADO program can work on a computer with KB983246 or install Windows 7 SP1!
OK,Thanks !
Wednesday, March 02, 2011 3:11 AM
Reply | Quote |
default20110 Points
All replies
0
Sign in to vote
Explain what "doesn't work" means.
m_pConn.CreateInstance() returns an HRESULT if it fails. What is its value?
Monday, February 28, 2011 4:57 PM
Reply | Quote |
Brian Muth (MCC, MVP) 49,380 Points
0
Sign in to vote
Hi:
Becuse I compiled on Windows 7 SP1,application only work the computer with Windows 7 SP1!or else m_pConn.CreateInstance() failed! HRESULT value: -2147467262
Tuesday, March 01, 2011 1:32 AM
Reply | Quote |
default20110 Points
0
Sign in to vote
i think first of all you check whether your windows 7 is 64 bit or 32 bit. if it is 64 bit and you have 64 bit driver used for database access i.e(check paths from program files or Program files(x86) it should be program files(x86) for 32 bit application on windows 7 64 bit). it is also worth checking whether you have proper version of drivers for ADO for 32 bit if your application is 32 bit and 64 bit if your application is 64 bit. By default Windows7 only install one of them depend on windows version at a time.
Fahd Anwar
Tuesday, March 01, 2011 10:54 AM
Reply | Quote |
Fahd Anwar فہد انورElixir Technologies Paki...315 Points
0
Sign in to vote
Hi:
Becuse I compiled on Windows 7 SP1,application only work the computer with Windows 7 SP1!or else m_pConn.CreateInstance() failed! HRESULT value: -2147467262
That value is 0x80004002, which is "No such interface is supported". There is something odd here. I'm wondering if you are using the #import directive on a version of ADO which is not available on earlier versions of the operating system.
Tuesday, March 01, 2011 5:04 PM
Reply | Quote |
Brian Muth (MCC, MVP) 49,380 Points
0
Sign in to vote
Hi:
This is Windows 7 32bit! Install SP1 ,msado15.dll version:6.1.7601.17514. old version :6.1.7600.16385 of without SP1!
KB983264 contain : Msado15.dll 6.1.7600.20701 !
SO, If ADO program compiled on Windows 7 SP1 ,your ADO program can work on a computer with KB983246 or install Windows 7 SP1!
希望能给碰到类似问题的有点作用!
相关文章推荐
- Java程序数据库连接失败问题
- 项目报错:打开文件过多,数据库连接失败等资源问题
- 使用 EF Core 的 EnableRetryOnFailure 解决短暂的数据库连接失败问题
- VC 使用ADO连接数据库的问题!error C2059: 语法错误 : “”
- 解决cognos创建数据源连接本地数据库失败问题
- VC 使用ADO连接数据库的问题!error C2059: 语法错误 : “<L_TYPE_raw>”
- 解决php原生连接数据库失败的问题(1)
- 关于VC数据库开发中数据库连接与效率的问题-----一点体会和经验
- ASP.NET2.0网站配置的数据库连接失败问题(没有安装SQLEXPRESS数据库的时候)
- 解决php连接数据库失败却无报错问题
- php远程连接虚拟机mongo数据库失败问题(奇葩)
- vc使用ado连接数据库WIN7平台问题
- Windows7旗舰版安装PLSQLDeveloper连接数据库遇到:ora-12514 问题和ORA-12545:因目标主机或对象不存在,连接失败”解决方法
- 如何修复VUM在客户端启用之后报数据库连接失败的问题
- 【経験談】VS2013创建数据库连接失败问题
- 如何修复VUM在客户端启用之后报数据库连接失败的问题
- VC++ 6.0 ADO连接数据库中出现的问题
- ASP.NET2.0网站配置的数据库连接失败问题
- html嵌入applet,跨ip时报数据库连接失败问题解决
- sqlite3数据库连接失败的问题