Solved

ADO 2.5 Connections in Visual C++ 6

Posted on 2000-03-14
6
381 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
ID: 2615218
0
 
LVL 5

Expert Comment

by:Wyn
ID: 2615223
0
 
LVL 5

Expert Comment

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

Regards
W.Yinan
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Author Comment

by:PedroG
ID: 2615344
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
ID: 2616523
What is the value of hr? You probably forgot to call CoInitializeEx().
0
 
LVL 2

Author Comment

by:PedroG
ID: 2618825
Yes that is write, i've founded that out yesterday
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Importing Special Characters in Dynamics GP Through Integration Manager 3 69
lucky13 challenge 11 122
Line meaning 9 82
firstChar challenge 13 110
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

920 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

14 Experts available now in Live!

Get 1:1 Help Now