Solved

ADO not working on NT4 when compiled under W2K

Posted on 2000-03-02
7
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 
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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

687 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