15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


DAO isn't writing a binary memo field

Matthias Bohlen -- MATTES@logotec.com
Friday, September 20, 1996

Environment: VC++ 4.0, NT 3.51

Hello,

I have an application that uses DAO with an MS Access Database. It should 
write a CByteArray into a MEMO field of the records.

I use the following code:

        //{{AFX_FIELD_MAP(CClassSet)
        pFX->SetFieldType(CDaoFieldExchange::outputColumn);
        DFX_Text(pFX, _T("[VERSION]"), m_version);
        DFX_Text(pFX, _T("[CLASS]"), m_class);
        DFX_Text(pFX, _T("[MEMBER]"), m_member);
        DFX_Binary(pFX, _T("[DESCRIPTION]"), m_description);
        DFX_Text(pFX, _T("[AUTHOR]"), m_author);
        DFX_Text(pFX, _T("[INCLUDEFILE]"), m_includefile);
        //}}AFX_FIELD_MAP

All the other fields come OK when I look at the database inside MS Access. 
Only the DESCRIPTION field is always empty.

I verified that the m_description member is not empty before the Update() call.

Does anyone know what's wrong here?

Best regards...
Matthias

o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o-o

The ZEN master: "If you have a stick, I'll give you a
stick. If you have not, I'll take that stick away from
you".

The banker: "If you have money, I'll give you money.
If you have not, I'll take that money away from you".

----------------------------+--------------------------
Matthias Bohlen             |  Logotec Software GmbH
Phone: +49 228 64 80 520    |  Chateauneufstr. 10 
FAX:   +49 228 64 80 525    |  D-53347 Alfter, Germany
                            |  http://www.logotec.com/
E-mail: mattes@logotec.com  |  CAD systems development
----------------------------+--------------------------



John Bundgaard -- johnb@image.dk
Tuesday, September 24, 1996

To make sure a binary transfer to the DAO database is actually preformed,
the you have to set the field non-NULL, and dirty.

Example:

	CClassSet rs;
	rs.Edit();

	//
	// Transfer data to recordset
	//

-->	rs.SetFieldNull(&rs.m_description,FALSE);
-->	rs.SetFieldDirty(&rs.m_description,TRUE);

	rs.Update();
	rs.Close();

John Bundgaard
johnb@image.dk





| Вернуться в корень Архива |