I am new to visual C++, but an old hat at VB6.
Is it possible to use ADO in VC++ and if so..how?
I am new to visual C++, but an old hat at VB6.
Is it possible to use ADO in VC++ and if so..how?
It is, by using COM. But I would advise against it.
First, COM is an advanced topic and you need to know a good deal about C++ before you can approach it.
Second, ADO was designed for languages supporting Automation and is tiresome to use from C++ because of the various VARIANTs you come across all the time.
Third, nearly all ADO documentation was written from the viewpoint of the Automation client. In VB it might be easy:
myvar = myobj(3);
but in C++ the same is quite complicated, with the need for decoding VARIANTs and SAFEARRAYs and such. This difference is not accounted for in the documentation.
Fourth, COM pointers are constantly retrieved in ADO. Simply releasing every single one again is very tiresome. Not to mention the loads of error handling that VB does all for you.
All the buzzt!
CornedBee
"There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
- Flon's Law