Hi,
I am trying to pass an image to a SQL stored procedure but have no success. I don't know what data type or length to use for the image parameter to be passed to the stored procedure. Received a "Parameter object is improperly defined. Inconsistent or incomplete information was provided." error message when running the cmdExecuteSP_Click() sub below. Could someone help?
Thanks,
Ken
Notes: 1) datatype is image for the image field in the SQL table.
2) Use bound object frame (photo1) to store the image (not image file).
3) Access 2007 and SQL 2005
4) Use stored procedure with one parameter, @photo1 (image type), to insert image to table.
===========================================
Private Sub cmdExecuteSP_Click()
Dim cmd As ADODB.Command
Set cmd = New ADODB.Command
cmd.ActiveConnection = "DSN=STDB;Trusted_Connection=Yes;DATABASE=STDB ;"
cmd.CommandText = "usp_tblTest2_Insert01b"
cmd.CommandType = adCmdStoredProc
' need help with statement below
cmd.Parameters.Append cmd.CreateParameter("@photo1", adLongVarBinary, adParamInput, 2500, photo1.Value)
cmd.Execute
End Sub