ado访问数据库出现的怪异现象同样的程序,在一台机器中正常运行,另一台就报错,并且报错的机器以前运行此程序也是好好的!前面已经
::CoInitialize(NULL);
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename ("EOF", "adoEOF") 下面是出错位置的代码:
hr = m_pConnection.CreateInstance( __uuidof(Connection) );
if( !SUCCEEDED(hr) )
return 0;CreateInstance出错,hr的返回值是:REGDB_E_CLASSNOTREG,我到底是什么东西没有注册啊?谢谢大家帮忙!
::CoInitialize(NULL);
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename ("EOF", "adoEOF") 下面是出错位置的代码:
hr = m_pConnection.CreateInstance( __uuidof(Connection) );
if( !SUCCEEDED(hr) )
return 0;CreateInstance出错,hr的返回值是:REGDB_E_CLASSNOTREG,我到底是什么东西没有注册啊?谢谢大家帮忙!
Also can indicate that the type of server you requested in the
CLSCTX enumeration is not registered or the values for the server
types in the registry are corrupt.
可能是2楼所说的原因,不妨试下.重装下mdac2.8.
xp sp2装不了2.8
hr = m_pConnection.CreateInstance("ADODB.Connection")
CoInitialize(NULL);
m_pConnection.CreateInstance(__uuidof(Connection));添加m_pConnection申明