1

I want to use the OleDB interfaces directly to open a connection to a DB, create a command and executing it (for example using the ICommandText interface).

The main thing I can't find is how to create the connection and the command object and how to connect the object that implements the ICommandText to the connection. In ADO I would just use the ActiveConnection property but I want to do this directly on the OleDB interfaces.

Also, if anyone can recommend a tutorial to OleDB, ether online or a book, free or not that would be great (but a tutorial and not just a reference / API)

I'm using C++ but any native code would be fine.

2 Answers 2

3

MSDN has a lot on this. http://msdn.microsoft.com/en-us/library/502e07a7.aspx is a sort of index into it, including several pages of concepts and others of samples. Should get you started.

http://msdn.microsoft.com/en-us/library/8kaf36d4.aspx specifically starts a File, New, Project and gets you connected to the db and selecting some data.

Sign up to request clarification or add additional context in comments.

Comments

0

Besides the MSDN documentation. Here are a few links I found useful when looking a using the OLEDB ATL templates. They are a bit dated, but I think they will still offer value.

http://www.codeproject.com/kb/database/oledbconsumer1.aspx http://www.codeproject.com/kb/database/oledbconsumer2.aspx http://www.codeproject.com/KB/database/odl.aspx - They no longer maintain this library, but the source can be found on the internet.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.