What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 133 Stack Exchange communities.

Or, put another way, is anybody using the COM interface to ADO in C++?

I need to connect to MSSQL server with some degree of compiler-neutrality, so I've started implementing some stuff using Microsoft's ADO library ... but there are only 17 ADO C++ questions on StackOverflow, which leads me to believe that nobody is doing it this way.

Is StackOverflow correct? Is there something better than ADO for connecting to MSSQL server? Or is the msdn documentation just so awesome that nobody needs to ask any questions?

share|improve this question

migrated from stackoverflow.com Aug 6 '10 at 20:09

This question came from our site for professional and enthusiast programmers.

5  
update: now there are 18 such questions. some guy added one about "why are there so few questions tagged 'ado' and 'c++'". –  Matthew Lowe Aug 6 '10 at 19:31
    
some degree of compiler-neutrality <-- Last I checked, COM was supported only with Microsoft's compilers. –  Billy ONeal Aug 6 '10 at 19:31
    
@Billy ONeal: I'm pretty sure I could use COM on borland compilers... Thinking about it as long as all required functions are available, compiler shouldn't matter at all. –  SigTerm Aug 6 '10 at 19:37
    
@SigTerm: But that compiler would have to parse IDL, and most don't do that. Didn't know about Borland -- MingGW certainly can't do it :( –  Billy ONeal Aug 6 '10 at 19:40
1  
@Matthew: Man, who's that joker? He should know that a question like that belongs on Meta! 8 D –  Task Aug 6 '10 at 19:40
    
The question really isn't about Stack Overflow. It is about the technology choices of the Stack Overflow userbase. In any case, it is not objectively answerable. –  dmckee Aug 6 '10 at 20:02
1  
Much ADO about nothing... –  FredOverflow Aug 6 '10 at 20:08
2  
WTF, this got migrated to meta? Surprise! That comes with a curse! I hope the guys you work for come in next week, glance at your code, and shuffle it around for no good reason. –  Matthew Lowe Aug 7 '10 at 1:18
    
@Matthew Ha! I shuffle around my own code thank you very much... –  Tyler Carter Aug 7 '10 at 1:55
    
@Matthew: Because it is not a programming question, it is a question about StackOverflow. And to answer title your question: because few people have asked such questions. To answer the how to question: when I needed to do this a few years ago I just translated the VB code into ATL. –  Richard Aug 8 '10 at 9:04
1  
@Richard: While it may /appear/ to be a question about StackOverflow, it is /really/ a question about the best way to interface with Microsoft SQL server using plain old C++. Many clever readers understood this. =D –  Matthew Lowe Aug 9 '10 at 14:18
    
@Matthew: The Q in the title is MSO. The body is different. Two different questions, and people are answering the one in the title. –  Richard Aug 10 '10 at 21:01

4 Answers 4

up vote 1 down vote accepted

Is there something better than ADO for connecting to MSSQL server?

ODBC? I donno... It probably depends on your definition of "better".

I suspect Neil's on the right track here though; the sort of people who ask tons of basic DB questions aren't the sort who really do well using C++.

Or is the msdn documentation just so awesome that nobody needs to ask any questions?

You're a funny man, Mr. Lowe.

share|improve this answer
    
Like I said, .Net Data Providers. ODBC is slow, it translates. Data Providers (generally) use native drivers. –  JustBoo Aug 6 '10 at 21:36
    
Yes, I use ODBC whenever I need to do database stuff in C++ - ADO is more suited to languages like VB. –  nb69307 Aug 6 '10 at 21:38
2  
@JustBoo ODBC is not slow - in fact it is the native interface to some databases, and has typically been used as the standard way of accessing databases for high-performance applications like data warehousing. But like I said, OT here. –  nb69307 Aug 6 '10 at 21:39
    
On this one, I'ma go with "because of ODBC". –  Matthew Lowe Aug 7 '10 at 1:36

People use C++ to write COM servers, and those people tend to know exactly what they are doing and so don't ask many questions (ex COM server writer speaking). People typically don't use C++ to write COM clients to existing servers like ADO.

I have to say, I think this is OT on Meta.

share|improve this answer
    
Then -- oh wise Neil Butterworth, x-COM-server-writer (I really liked that game by the way) -- how would such stalwarts go about putting data in the already-existing Microsoft SQL Server? –  Matthew Lowe Aug 7 '10 at 1:23
    
Ignore that. From your comment below, I now see that they use ODBC. Which does make a certain amount of sense. –  Matthew Lowe Aug 7 '10 at 1:32

COM objects have nothing to do with C++. I regularly use VB documentation of COM objects to write Python code that uses COM. Focus on the ADO model and if you have a specific problem, then ask us about that specific issue.

share|improve this answer
1  
I don't think this answers the question. –  Billy ONeal Aug 6 '10 at 19:40
    
Billy ONeal, I think you're right. –  Matthew Lowe Aug 7 '10 at 1:23

If I remember my progression it was DAO (used it for years) then RDO (flopped) then ADO and now the "hot" thing is .Net Data Providers.

I'm thinking ADO is percieved as not the hot thing anymore, therefore it does not get as much "action."

Personally I like and still use DAO and ADO, legacy apps mostly. Data Providers do make using DB's even easier. Given that, I see no reason not to use ADO if you want.

HTH

share|improve this answer
    
I do get the impression that Microsoft wants us to use .NET for these sorts of things, but I'm intentionally not using .NET ... for this library at least. –  Matthew Lowe Aug 7 '10 at 1:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .