You have to derive your recordset from the CRecordset class and bind all columns you need to the variables prior to call the recordset’s Open member function. Use the ClassWizard to create a CYourRecordset class derived from the CRecordset and bind columns. The columns will be bound to the variables in the CYourRecordset:: DoFieldExchange function.
A.M.
My Latest Articles: CCustomBitmapButton - An owner-draw button and a frame for the caption bar, in one class. CCustomTabCtrl - A clone of the Excel tab sheet control.
Thanks for your help. I have done the following changes.
I have dereived a class from Crecordset and done DoFieldExchange as below
====
class CMyProjectClass : public CRecordset
{
public:
CMyProjectClass();
virtual ~CMyProjectClass();
virtual void DoFieldExchange( CFieldExchange* pFX );
Problem, at the statemet rs.Open ......
I am forced to give all the details again, (please see the attachement for the steps).
Once I did, CDBException exception is raised, with reason
====================
No columns were bound prior to calling SQLFetchScroll/SQLExtendedFetch
====================
A.M.
My Latest Articles: CCustomBitmapButton - An owner-draw button and a frame for the caption bar, in one class. CCustomTabCtrl - A clone of the Excel tab sheet control.
A.M.
My Latest Articles: CCustomBitmapButton - An owner-draw button and a frame for the caption bar, in one class. CCustomTabCtrl - A clone of the Excel tab sheet control.
Your recordset files are not complete. Use Class Wizard to generate these files (View->ClassWizard->Add Class->New).
A.M.
My Latest Articles: CCustomBitmapButton - An owner-draw button and a frame for the caption bar, in one class. CCustomTabCtrl - A clone of the Excel tab sheet control.
Hi, I have done some R&D and able to solve the problem, I am not getting any error, but values of the variables are the same as they have been set in the constructor.
I think we are close to answer, please help.
I am attaching the files again.
You don't need the select statement in the recordset open. The CRecordset class handles all that for you. I don't know if that's your current problem, but it's definitely a problem.
Hi, I have done some R&D and able to solve the problem, I am not getting any error, but values of the variables are the same as they have been set in the constructor.
I think we are close to answer, please help.
I am attaching the files again.
Use the Class Wizard to generate your recordset files. In your files the macros in *.cpp (AFX_FIELD_INIT, AFX_FIELD_MAP AFX_FIELD) and *.h (AFX_FIELD, AFX_VIRTUAL) are missed. I have attached sample files generated by the Class Wizard.
A.M.
My Latest Articles: CCustomBitmapButton - An owner-draw button and a frame for the caption bar, in one class. CCustomTabCtrl - A clone of the Excel tab sheet control.
You don't need the select statement in the recordset open. The CRecordset class handles all that for you. I don't know if that's your current problem, but it's definitely a problem.
It's not true. The CRecordset class doesn't do it for you. You have to specify the select statement in the recordset open function.
Last edited by amarcode; January 4th, 2005 at 09:49 PM.
A.M.
My Latest Articles: CCustomBitmapButton - An owner-draw button and a frame for the caption bar, in one class. CCustomTabCtrl - A clone of the Excel tab sheet control.
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.