Implementing OLE DB interfaces

I'm new to COM programming and I need to implement an OLE DB interface onto a custom data server.  The actual interface is fairly simple, we would only need to support 2 types of query's, I think we can use ICommand to pass an SQL string.

My problem is how to set up the component that implements the DataSource, Session, Command and Rowset interfaces.  In particular I'd like to define a component called, MyDataSource that implements the IDBInitialize, IDBCreateSession and IDBProperties interfaces.  What will my IDL file look like?  Can I get there using the ATL wizard in Visual C++ 5.0?  Or should I read a good book on COM and OLE and implement a solution based on code samples?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Do you want to write an COM object which uses OLEDB inside or You want to merely access the OLEDB interface. In later case you don't have to know much about the COM. In that case you only need to learn how to use interfaces. But if you want to make an object which internally uses the OLE DB then you might have to know more about how to create a COM object.
gerry99Author Commented:

Neither,  I want to write a COM object that exposes a colleciton of OLE DB interfaces so that a 3rd party client, in this case Cold Fusion, can make use of my DataSource object the same way it would use a DataSource object to one of the commerical database engines.
Tommy HuiEngineerCommented:
The easiest way would be to upgrade your compiler to VC++ 6.0. It has a wizard that generates an OLEDB provider for you.

Barring that, you could get a copy of the book "Teaching Yourself OLEDB and ADO in 21 Days" by Sams publishing. Sorry, I don't have the ISBN or author handy. The book covers how to write an OLEDB provider using only C++.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

I'm interested in this from the CF standpoint
gerry99Author Commented:

Thanks for the suggestion.  I am upgrading to VC++ 6.0, just to get the OLE DB application wizard.  I've seen mixed reviews on the SAMs book, so I'll pass on that.  

If the VC++ wizard can give me a DLL that I can just fill in the functionality for, it will have paid for itself.

BTW, "nullterminator" on thing you should know about using COM with Cold Fusion is that you cannot connect the Microsoft web server to a COM interface being running in an EXE.  Hence what I'm shooting for is a OLE DB dll connecting back to my EXE based datasource through a Named pipe.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.