...

View Full Version : Accessing databases on the net from a c++ app (URGENT!!)



d000hg
03-26-2004, 01:39 PM
I'm already accessing my MSAccess DB using asp.net/ado.net with the oledb classes and methods, but I'd like to do something similar from a C++ app written on my PC. I'm a little bewildered though:[list=1]
ADO, OLE, ODBC... it seems these can all be used for my db, what's the difference?
Presuming I was to use oledb or odbc, where do I start (I don't have VS.net only 6.0)?
What's the process for connecting & performing queries on a remote (or local) db? Akin to the way it's done from a web-page?
Where can I find good tutorials (my c++ & sql is excellent just not how it all links together!)?
[/list=1]

[edit]
Just to clarify, I'm not currently using mfc if possible. I want the process to be:
1)Create a connection to the database (preferably on the net but a local location would suffice - NOT setting up the project for a specific DB)
2)Create a command to get information from the db
3)Execute the command and get hold of the data
4)Go through the data
5)Close the connections.

All the examples I've seen have you building a VS project about some particular database wheras I want to be able to select a database from somewhere and do stuff to it. There must be standard classes around to do this like how you do in asp; I'm not after writing a load of code to do that. In asp.net you just create a connection, command object etc then pass the command to the connection and get a set of data back - that's what I'm after here.

Thankyou.

sad69
03-29-2004, 08:22 PM
I just quickly entered a search on Google, and came up with these links:
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20918430.html
http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/ad/samples/cpp/s-README_Linux.htm
http://www.hotscripts.com/Detailed/11714.html
http://www.devarticles.com/c/a/MySQL/Using-MyODBC-to-Connect-to-a-Remote-Database/

It looks to me as if it depends on what database you're going to use, and you should get the appropriate API for it.

I've never done anything like this using C++, so I apologise, I cannot be of more assistance.

Good luck,
Sadiq.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum