forloop
asked on
ADO not working on NT4 when compiled under W2K
Whenever I compile a VC6 project under W2K that makes use of ADO (via #import), it won't run under NT4/Win9x (But does under W2K). Any way to solve this problem?
To be more specific on the error, it fails on a CreateInstance call to any ADO object.
I'm sure this is pretty common, but I haven't been able to find a work around anywhere yet.
To be more specific on the error, it fails on a CreateInstance call to any ADO object.
I'm sure this is pretty common, but I haven't been able to find a work around anywhere yet.
What is the error number returned?
ASKER
0x80004002: E_NOINTERFACE
No such interface supported
Here's the code.. It dies on the recordset creation, not the connection:
_ConnectionPtr pConn;
_RecordsetPtr pRS;
HRESULT hr;
CString str2;
hr=pConn.CreateInstance(__ uuidof(Con nection));
if (FAILED(hr))
{
str2.Format("Could not create Connection object: Error %x",hr);
AfxMessageBox(str2);
return;
}
hr=pRS.CreateInstance(__uu idof(Recor dset));
if (FAILED(hr))
{
str2.Format("Could not create Recordset object: Error %x",hr);
AfxMessageBox(str2);
return;
}
No such interface supported
Here's the code.. It dies on the recordset creation, not the connection:
_ConnectionPtr pConn;
_RecordsetPtr pRS;
HRESULT hr;
CString str2;
hr=pConn.CreateInstance(__
if (FAILED(hr))
{
str2.Format("Could not create Connection object: Error %x",hr);
AfxMessageBox(str2);
return;
}
hr=pRS.CreateInstance(__uu
if (FAILED(hr))
{
str2.Format("Could not create Recordset object: Error %x",hr);
AfxMessageBox(str2);
return;
}
could u show th import statment + which version of ado do u use?
I think it's supposed to be _Connection
hr=pConn.CreateInstance(__ uuidof(_Co nnection)) ;
hr=pConn.CreateInstance(__
ASKER
#import <c:\program files\common files\system\ado\msado15.d ll> no_namespace rename ( "EOF", "adoEOF" )
hr=pConn.CreateInstance(__ uuidof(_Co nnection)) ; // doesn't work.
The connection object loads fine. The recordset object is the one having the problem.
hr=pConn.CreateInstance(__
The connection object loads fine. The recordset object is the one having the problem.
ASKER
Also, if I change the second one to:
hr=pRS.CreateInstance(__uu idof(_Reco rdset));
I get an Error: 80040154 (Class not registered)
hr=pRS.CreateInstance(__uu
I get an Error: 80040154 (Class not registered)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.