Check that
SqlStr3
is a valid string.
For example a common way to "break" a
CString
object is to use its
GetBuffer
method, modify the string, and forget to call
ReleaseBuffer
...
I don't understand what might be wrong. Try to comment a few lines to know exactly which one raises the problem. For example:
CString SqlStr4;
SqlStr4 = "INSERT INTO log SET grab_date= '";
SqlStr4 +=strDateTime;
SqlStr4 += "',ip_address='";
SqlStr4 += "',image='";
SqlStr4 += StrByte;
SqlStr4 +="';";
Once you found which lines (it might be several ones) causes the problem, do the same thing with that string. For example, if you found out that only
SqlStr3
causes the problem, then look carefully how
SqlStr3
is built. Try to build it a different way...