Solved

ADO 2.5 Connections in Visual C++ 6

Posted on 2000-03-14
6
380 Views
Last Modified: 2013-11-20
I've instaled ADO 2.5 in a Win 98  machine.

All works ok form VB and VBA, but i can't get it to work in Visual C++.

I'm using a _ConnectionPtr variable but create instance allways fails.

the follwing code allways fails

_ConnectionPtr mConn;

hr = mConn.CreateInstance ("ADODB.Connection");
 if(FAILED(hr))
 {
   mConn = NULL;
   return FALSE;
 }

also i've tried to replace "ADODB.Connection" (wich should be ok, cos i can create the object using a simple CreateObject in VB) by
__uuidof(_Connection)
0
Comment
Question by:PedroG
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:Wyn
Comment Utility
0
 
LVL 5

Expert Comment

by:Wyn
Comment Utility
0
 
LVL 5

Expert Comment

by:Wyn
Comment Utility
Check above and I think it will clear all problems and you will gain more details...

Regards
W.Yinan
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 2

Author Comment

by:PedroG
Comment Utility
Guys i do not need to be tought how to work with ADO. I only can't creat a ConnectionPtr object!!!

AND BELEIVE ME THAT I'VE TRIED ALL THE WAYS THAT ARE IN THE MSDN
0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
Comment Utility
What is the value of hr? You probably forgot to call CoInitializeEx().
0
 
LVL 2

Author Comment

by:PedroG
Comment Utility
Yes that is write, i've founded that out yesterday
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now