The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.
One of a set of tools we're offering as a way of saying thank you for being a part of the community.
To save a block of binary data:
*** Before this open recordset and make a call to AddNew()
*** or Edit().
// First set size of CByteArray to the size needed.
rs.m_rgBin.SetSize( nSizeNeeded );
// If you are updating an existing record,
// check if it has changed.
// Otherwize ommit this test.
if(memcmp(&rs.m_rgBin[0], pMyData, rs.m_rgBin.GetSize()))
{
// Its changed.
// Copy the memory block into the CByteArrar object
memcpy(&rs.m_rgBin[0], pMyData, rs.m_rgBin.GetSize());
// Flag field as having a value, and dirty
rs.SetFieldNull(&rs.m_rgBi
rs.SetFieldDirty(&rs.m_rgB
}
// NOTE: If you want to clear the field in the database
// make this call: rs.m_rgBin.SetSize(0) and also
// do the SetFieldDirty() call.
*** Somewhere after this call update to store the data.
---
To load a block of binary data:
// Are the field empty?
if(rs.m_userData.GetSize()
{
// No, copy to our local buffer pMyData
memcpy(pMyData, &rs.m_rgBin[0], rs.m_rgBin.GetSize());
}
else
{
//
// TODO: Insert code for handling empty field from database.
//
}
------
THATS IT !!!!!!!!
The key to all this is the two functions SetFieldNull() and SetFieldDirty();