Pls Help! How to know what I change after modify a colum in a DataGrid Control?

Pls Help! How to know what I change after modify a colum in a DataGrid Control?

Post by AA » Thu, 09 Nov 2000 04:00:00



For the DataGrid Control , it connect to a with a ADO Data Control.  In the ADO control,
it have a event called "RecordChangeComplete".  When a field in a DataGrid Control is modified,
the "RecordChangeComplete" will be triggered. ( )  
OnFieldChangeComplete(long cFields, VARIANT FAR* Fields, LPDISPATCH pError, long FAR* adStatus, LPDISPATCH pRecordset)
But, I don't know how to get modified information in the modified colum.
--

Regards,
Anthony Lam
Delbore.com Ltd

 
 
 

Pls Help! How to know what I change after modify a colum in a DataGrid Control?

Post by AA » Thu, 09 Nov 2000 04:00:00


WHen I try to write the ID and bitmap into database, I find I just only write the m_id to the database but the m_pic  is NULL in database. What is the problem?
...
//m_hDIB is HDIB
CBitmapRecordSet rs(&db); //CBitmapRecordSet is inheret from CRecordset
rs.Open();
rs.AddNew();
rs.m_id =10;
rs.m_pic.m_hData = GlobalAlloc(GMEM_FIXED, GlobalSize(m_hDIB ));
void* pData = GlobalLock(m_hDIB);
void *pData2 = GlobalLock(rs.m_pic.m_hData);
if(pData2)
{
      rs.m_pic.m_dwDataLength = GlobalSize(m_hDIB );
      memcpy(pData2, (void*)((BYTE*)pData), GlobalSize(m_hDIB) );

Quote:}

 GlobalUnlock(m_hDIB);
 GlobalUnlock(rs.m_pic.m_hData);
 rs.SetFieldDirty(NULL, TRUE);
 rs.Update();
 rs.Close();
 GlobalFree(rs.m_pic.m_hData);

 
 
 

Pls Help! How to know what I change after modify a colum in a DataGrid Control?

Post by AA » Thu, 09 Nov 2000 04:00:00


WHen I try to write the ID and bitmap into database, I find I just only write the m_id to the database but the m_pic  is NULL in database. What is the problem?
...
//m_hDIB is HDIB
CBitmapRecordSet rs(&db); //CBitmapRecordSet is inheret from CRecordset
rs.Open();
rs.AddNew();
rs.m_id =10;
rs.m_pic.m_hData = GlobalAlloc(GMEM_FIXED, GlobalSize(m_hDIB ));
void* pData = GlobalLock(m_hDIB);
void *pData2 = GlobalLock(rs.m_pic.m_hData);
if(pData2)
{
      rs.m_pic.m_dwDataLength = GlobalSize(m_hDIB );
      memcpy(pData2, (void*)((BYTE*)pData), GlobalSize(m_hDIB) );

Quote:}

 GlobalUnlock(m_hDIB);
 GlobalUnlock(rs.m_pic.m_hData);
 rs.SetFieldDirty(NULL, TRUE);
 rs.Update();
 rs.Close();
 GlobalFree(rs.m_pic.m_hData);

--

Regards,
Anthony Lam
Delbore.com Ltd

 
 
 

1. Pls Help! How to know what I change after modify a colum in a DataGrid Control?

For the DataGrid Control , it connect to a with a ADO Data Control.  In the ADO control,
it have a event called "RecordChangeComplete".  When a field in a DataGrid Control is modified,
the "RecordChangeComplete" will be triggered. ( )  
OnFieldChangeComplete(long cFields, VARIANT FAR* Fields, LPDISPATCH pError, long FAR* adStatus, LPDISPATCH pRecordset)
But, I don't know how to get modified information in the modified colum.
--

Regards,
Anthony Lam
Delbore.com Ltd

2. linking database queries

3. Help pls..Datamodel change control

4. How To Move Back To SQL6.5 (from SQL2000)

5. can't modify table, pls help

6. Crystal RTF Exporting Problem

7. Pls help: Datagrid

8. Pro*C help

9. Refreshing Datagrid at runtime, pls help

10. Changes in DataGrid control not reflected in the database

11. reflecting change in RecordSource in DataGrid Control

12. Changing the color of each line a datagrid control