"String data, length mismatch"

"String data, length mismatch"

Post by Simon Davie » Thu, 23 Dec 1999 04:00:00



Does anybody know why I'm receiving this error when I AppendChunk to a text
(blob) column and then update the ado recordset:

"String data, length mismatch"

Thanks,
Simon

 
 
 

1. SQL Error "String data, length mismatch" when writing Blob

I'm using VC++ 6.0 and SQL server 7.0
The blob variable is of the type "text" in the table and CLongBinary the
recordset.

Please help me I'm going crazy about this message!!!

 try

      ...
      rs.AddNew();

      CFileStatus fileStatus;
      pFile->GetStatus(fileStatus);

      rs.myBlob.m_dwDataLength = fileStatus.m_size;
      HGLOBAL hGlobal  = GlobalAlloc(GPTR, fileStatus.m_size);
      rs.myBlob.m_hData = GlobalLock(hGlobal);

      pFile->ReadHuge(rs.myBlob, fileStatus.m_size);

      rs.SetFieldDirty(&rs.myBlob);
      rs.SetFieldNull(&rs.myBlob, FALSE);

      rs.Update();
      GlobalUnlock(hGlobal);

      rs.Close();
 }
 catch(CException* pE){
      pE->ReportError();
      pE->Delete();
      return FALSE;
 }

2. binary data into image column

3. "Runtime Error 13 Data Type mismatch"

4. Organizing tables

5. Help: "Data type mismatch"

6. User Groups In NY area

7. The ""string""

8. Max Tables involved in FK constraints Deletion check

9. String data, length mismatch

10. solving String data, length mismatch

11. String data, length mismatch - ODBC Error 22026

12. solving String data, length mismatch

13. string data length mismatch.