?
Solved

ADO not working on NT4 when compiled under W2K

Posted on 2000-03-02
7
Medium Priority
?
287 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
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 200 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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

770 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