Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

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.
0
forloop
Asked:
forloop
1 Solution
 
NickRepinCommented:
What is the error number returned?
0
 
forloopAuthor Commented:
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;
      }
0
 
yositCommented:
could u show th import statment + which version of ado do u use?
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
yositCommented:
I think it's supposed to be _Connection
hr=pConn.CreateInstance(__uuidof(_Connection));

0
 
forloopAuthor Commented:
#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.

0
 
forloopAuthor Commented:
Also, if I change the second one to:

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

I get an Error: 80040154 (Class not registered)
0
 
pjknibbsCommented:
Windows 2000 installs a new version of ADO (version 2.5) which is obviously not normally present on earlier versions of Windows. You'll have to write an installer for your app which installs the correct version of ADO onto the user's system.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now