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?

Thanks,
LVL 1
gerry99Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Tommy HuiConnect With a Mentor EngineerCommented:
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++.
0
 
basantCommented:
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.
0
 
gerry99Author Commented:
basant,

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.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
chensuCommented:
0
 
NullTerminatorCommented:
I'm interested in this from the CF standpoint
0
 
gerry99Author Commented:
thui,

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.
0
All Courses

From novice to tech pro — start learning today.