DoDataExchange with 2 tables 
Author Message
 DoDataExchange with 2 tables

Hi!

I write an app that needs to access the a db with, lets
say, 2 tables. I had created 2 classes derived from
CRecordset. My problem is when I try to call
DoDataExchange, I got an access violation when trying to
access the second table.

If I just want the records from the first one, everything
is fine.

Where is my problem, did I forgot a call somewhere?

Thanks



Fri, 12 Nov 2004 22:46:21 GMT  
 DoDataExchange with 2 tables
Franck

Could you show some code?

Have a look at these two links, especially the remarks section in the first
link:

http://msdn.microsoft.com/library/en-us/vclib/html/_mfc_CWnd.3a3a.DoD...
.asp

http://msdn.microsoft.com/library/en-us/vclib/html/_mfc_CRecordset.3a...
xchange.asp

best regards,

roy fine


Quote:
> Hi!

> I write an app that needs to access the a db with, lets
> say, 2 tables. I had created 2 classes derived from
> CRecordset. My problem is when I try to call
> DoDataExchange, I got an access violation when trying to
> access the second table.

> If I just want the records from the first one, everything
> is fine.

> Where is my problem, did I forgot a call somewhere?

> Thanks



Fri, 12 Nov 2004 23:19:24 GMT  
 DoDataExchange with 2 tables
Sure, here it is!

void CTestView::DoDataExchange(CDataExchange* pDX)
{
DDX_Text(pDX, IDC_CLASSOP, m_pSet->m_ClassOp);
DDX_Text(pDX, IDC_SMYS, m_pSet->m_SMYSP);

// The following line is the problem...
DDX_Text(pDX, IDC_CLASSDESIGN, m_pCDesign->m_ClassDesign);

CRecordView::DoDataExchange(pDX);

Quote:
}

Note: m_pSet and m_pCDesign are attributes coming from 2
different classes derived from CRecordset. Also, the first
one (m_pSet) has been created with the wizard. The other
one too, but at a later time..

Thanks for your help!

Quote:
>-----Original Message-----
>Franck

>Could you show some code?

>Have a look at these two links, especially the remarks

section in the first
Quote:
>link:

>http://msdn.microsoft.com/library/en-

us/vclib/html/_mfc_CWnd.3a3a.DoDataExchange
Quote:
>..asp

>http://msdn.microsoft.com/library/en-

us/vclib/html/_mfc_CRecordset.3a3a.DoFieldE
Quote:
>xchange.asp

>best regards,

>roy fine



>> Hi!

>> I write an app that needs to access the a db with, lets
>> say, 2 tables. I had created 2 classes derived from
>> CRecordset. My problem is when I try to call
>> DoDataExchange, I got an access violation when trying to
>> access the second table.

>> If I just want the records from the first one,
everything
>> is fine.

>> Where is my problem, did I forgot a call somewhere?

>> Thanks

>.



Fri, 12 Nov 2004 23:31:37 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. MFC 7 has problem with DoDataExchange and Add Member Wizard

2. DoDataExchange functionality in ATL

3. Problem with DoDataExchange and PX_Short(...)

4. UpdateAllViews == DoDataExchange for all views ?

5. DoDataExchange

6. Bug inside DoDataExchange

7. DoDataExchange() called twice when viewing a property page

8. DoDataExchange question

9. DoDataExchange without OnOK()

10. DoDataExchange for CDialogBar?

11. Validation in OnKillfocus vs. DDV_ in DoDataExchange

12. Why doesn't DoDataExchange work?

 

 
Powered by phpBB® Forum Software