Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 385
  • Last Modified:

MFC CLongBinary

I'm using CRecordset and CLongBinary to insert image into SQLServer6.5 database.  I did call SetFieldDirty() after I called AddNew(), then I read image out of a image file into the buffer I allocated.  The data pointer in the CLongBinary object points to the data buffer.  But after update() call, the image field still seems to be null.  No exception was thrown.  Everything seems to be ok except when I look at the table, the field is null.  Why?
0
accord
Asked:
accord
1 Solution
 
piano_boxerCommented:
Try also calling SetFieldNull(&m_nMyClassMember, FALSE) after the SetFieldDirty(&m_nMyClassMember, TRUE) call.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now