Solved

ADO not working on NT4 when compiled under W2K

Posted on 2000-03-02
7
285 Views
Last Modified: 2013-12-03
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
Comment
Question by:forloop
7 Comments
 
LVL 15

Expert Comment

by:NickRepin
ID: 2578380
What is the error number returned?
0
 

Author Comment

by:forloop
ID: 2578554
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
 
LVL 1

Expert Comment

by:yosit
ID: 2579182
could u show th import statment + which version of ado do u use?
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Expert Comment

by:yosit
ID: 2579184
I think it's supposed to be _Connection
hr=pConn.CreateInstance(__uuidof(_Connection));

0
 

Author Comment

by:forloop
ID: 2580685
#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
 

Author Comment

by:forloop
ID: 2580752
Also, if I change the second one to:

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

I get an Error: 80040154 (Class not registered)
0
 
LVL 12

Accepted Solution

by:
pjknibbs earned 50 total points
ID: 2583086
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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

696 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question