Link to home
Start Free TrialLog in
Avatar of forloop
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.
Avatar of NickRepin
NickRepin

What is the error number returned?
Avatar of forloop

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(Connection));
      if (FAILED(hr))
      {
            str2.Format("Could not create Connection object: Error %x",hr);
            AfxMessageBox(str2);
            return;
      }

      hr=pRS.CreateInstance(__uuidof(Recordset));
      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(_Connection));

Avatar of forloop

ASKER

#import <c:\program files\common files\system\ado\msado15.dll> no_namespace rename ( "EOF", "adoEOF" )

hr=pConn.CreateInstance(__uuidof(_Connection)); // doesn't work.

The connection object loads fine. The recordset object is the one having the problem.

Avatar of forloop

ASKER

Also, if I change the second one to:

hr=pRS.CreateInstance(__uuidof(_Recordset));

I get an Error: 80040154 (Class not registered)
ASKER CERTIFIED SOLUTION
Avatar of pjknibbs
pjknibbs

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial