Hello -

I am trying to insert an image into an image datatype in SQL Server. I continually get the error message:

Microsoft OLE DB Provider for ODBC Drivers error '80040e57'

[Microsoft][ODBC SQL Server Driver]String data, right truncation

Here is the relevant code:

Open Filename For Binary As #1

'resize byte array, read in data, close it
ReDim bytChunk(LOF(1))
Get #1, , bytChunk()
Close #1

'Set up Command
'Dim objParam As New Parameter
objConn.ConnectionString = strConn
With objCommand
Set .ActiveConnection = objConn
.CommandText = "mhgroup.rcCert_UpdateSignature"
.CommandType = adCmdStoredProc

.Parameters.Append .CreateParameter("@User_ID", adInteger, adParamInput, , UserID)
.Parameters.Append .CreateParameter("@Sig_Pic", adLongVarBinary, adParamInput, 2147483647)
.Parameters.Append .CreateParameter("@Pic_Ext", adVarChar, adParamInput, 3, PicExt)
.Parameters.Append .CreateParameter("@Sig_Name", adVarChar, adParamInput, 50, SigName)

'set parameter value
.Parameters("@Sig_Pic").AppendChunk bytChunk

'Execute Command
End With

And here is the stored proc:

CREATE PROCEDURE mhgroup.rcCert_UpdateSignature
@User_ID int,
@Sig_Pic image,
@Pic_Ext varchar(3),
@Sig_Name varchar(50)

If anyone has any ideas what is wrong with this I would really appreciate the help.

Eric Workman