Interacting with web-based databases from c++ apps

Started by
2 comments, last by d000hg 20 years ago
I''m currently building a web site which deals with registration, user verification & details etc. I wondered how easy it would be to do the same things to the same database from a c++ app running on my pc. There''d have to be a way of connecting to the net, then a way of interacting with a database (I''m using MSAccess now ie Jet but actually connecting as an OLE DB). If I was using .net I think I could use the same classes (syste.Data.OleDb....) as I do from ADO.NET online - is that correct? Unfortunately I have visual c++ 6.0 so will have to do this the hard way! could you give me some tips as to what this will involve and how I''d start to go about it? Thanks
Advertisement
You can use the ADO COM objects, OLE DB, or use the ODBC libraries.
ADO is high-level (next generation OLE DB), ODBC is low-level.

ADO is buggy as hell, but it''s actually less buggy directly using the COM interfaces in C++ (VB6 has trouble without multiple implementations of the same connection point interface, which means it''s hard to make modulariz3e component with asyncronous operations).

ADO.Net is the next generation after ADO.

There''s a Database Template Library as well (which is portable becuse it''s based off ODBC).
The goal of this library is to make ODBC recordsets look just like an STL container

- Magmai Kai Holmlor

Not For Rent

[Look for information | GDNet Start Here | GDNet Search Tool | GDNet FAQ | MSDN RTF[L] | SGI STL Docs | STFW | Asking Smart Questions ]
[Free C++ Libraries | Boost | ACE | Loki | MTL | Blitz++ | wxWindows| Spirit(xBNF)]
[Free C Libraries | zlib ]

- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Thanks, on first impressions OLE sounds good I think. Would you care to point me in the direction of a tutorial or two? It should be relatively simple bar the connection process - in ASP/ADO you just connect with a string, then perform a query with another string. Once you''ve got the recordset it''s simple to actually get the data out. Is the process similar from a c++ app viewpoint? On first thoughts, actually drawing the tables to display data in windows should be the hardest part!?
Wow, I''ve actually got a set of tuts from msdn! In fact they have corresponding series for ADO, ODBC, OLEDB...

From what I''ve read ODBC seems the way I should go. It can be used from straight C/C++ wheras OLE and ADO require COM and the examples I find all use MFC - skills I want to get but one new thing at a time is best!

I''ve found some DSN-less connection strings and using ODBC it looks as simples as:
1)Get a few handles
2)Make a connection to the driver, specifying the database to be used.
3)Build and execute a SQL query
4)Interpret the results
5)Free the handles.

Is it this simple in reality? It looks from msdn like it would be SO easy in VS.net to do ODBC,OLE or whatever just by transposing the class-method names and the format of the connection string; makes me wish I had it now!

This topic is closed to new replies.

Advertisement