Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Methods to insert,delete records in database in vc++? I have used ExecuteSQl using CDatabase. Any other method is there in order to insert, delete and update records in MYSQL Database.


     CLongBinary m_BLOBImage;
CFileStatus fileStatus;
strfile.GetStatus(fileStatus);
    CString m_BLOBName = strfile.GetFileTitle();
    m_BLOBImage.m_dwDataLength = fileStatus.m_size;
SIZE_T dwbytes=(SIZE_T)fileStatus.m_size;
    HGLOBAL hGlobal     = GlobalAlloc(GPTR,dwbytes);
    m_BLOBImage.m_hData = GlobalLock(hGlobal);
strfile.Read(dbImages.m_BLOBImage.m_hData,(UINT)fileStatus.m_size);
Posted
Updated 23-Jun-11 0:21am
v2

1 solution

You can use the CRecordset class.
Specify the CDatabase pointer in the constructor of CRecordset.
This class had methods like AddNew, Delete, Edit, Update etc. that will do the job for you.
 
Share this answer
 
Comments
Gokulnath007 23-Jun-11 6:22am    
i want to save m_BLOBImage.m_hData value in the blob field of the database. Please help me how to do this.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900