CRecordset Alternatives
-
I recently switched from VS6 to VS.Net for writing unmanaged C++. I noticed they took away the Wizard to derive a class from a CRecordset and wrap it around a table. I only know how to access database using CDatabase and CRecordset (or a class derived from them). I am guessing that the idea is to get away from ODBC and to start using OLE or ADO. I found an article in a book describing a set of classes CADOConnection and CADORecordset. I cannot find neither of them mentioned on MSDN, so my first questions is does anyone heard of and used these classes and if so is there any documention on them. My Next question is what alternatives does anyone else like to use instead of CRecordset? I know that OLE is faster than ADO, but is that much faster and is ADO that much easier to use? One last question, for anyway using generic CRecordsets, what is the easiest way to tell if a field is null, I know i can do it from a class that is derived and has teh DDX calls, but what about just a CRecordset? JD
-
I recently switched from VS6 to VS.Net for writing unmanaged C++. I noticed they took away the Wizard to derive a class from a CRecordset and wrap it around a table. I only know how to access database using CDatabase and CRecordset (or a class derived from them). I am guessing that the idea is to get away from ODBC and to start using OLE or ADO. I found an article in a book describing a set of classes CADOConnection and CADORecordset. I cannot find neither of them mentioned on MSDN, so my first questions is does anyone heard of and used these classes and if so is there any documention on them. My Next question is what alternatives does anyone else like to use instead of CRecordset? I know that OLE is faster than ADO, but is that much faster and is ADO that much easier to use? One last question, for anyway using generic CRecordsets, what is the easiest way to tell if a field is null, I know i can do it from a class that is derived and has teh DDX calls, but what about just a CRecordset? JD
-
Hi, I personaly use ADO objects. Have a look at the article "ADO at a glance" for an introduction to ADO. Pyt
-
I recently switched from VS6 to VS.Net for writing unmanaged C++. I noticed they took away the Wizard to derive a class from a CRecordset and wrap it around a table. I only know how to access database using CDatabase and CRecordset (or a class derived from them). I am guessing that the idea is to get away from ODBC and to start using OLE or ADO. I found an article in a book describing a set of classes CADOConnection and CADORecordset. I cannot find neither of them mentioned on MSDN, so my first questions is does anyone heard of and used these classes and if so is there any documention on them. My Next question is what alternatives does anyone else like to use instead of CRecordset? I know that OLE is faster than ADO, but is that much faster and is ADO that much easier to use? One last question, for anyway using generic CRecordsets, what is the easiest way to tell if a field is null, I know i can do it from a class that is derived and has teh DDX calls, but what about just a CRecordset? JD
I have done my fair share of DB programming during the last years and all I have to say is... Stay away from ADO, it contains so many gotchas that it's plain silly. Also it really lacks the performance needed for heavy multi-user system. My recomendation would be OLEDB by using the ATL supportclasses (CCommand, CRowset and so on). Use the wizard to get the hang of things then write your own code by hand since the wizard (IMHO) is a bit to stupid to be used in production code. If you still REALLY want to use ADO get the MS Press book, Programming ADO (it's good), and read it cover-cover atleast 2 times then check out OLEDB again :)