I get an error when performing an update in an ado recordset in a binary field.
the db is IBM DB2 6, i´m using MSDASQL (oledb for odbc) and MDAC 2.1
the code is the following:
Sub SaveSign()
Dim SignBmp() As Byte
Dim dsSign as cSVSRes 'a class of an ado recordset
SetPointer Me
On Error GoTo ErrHnd
ReDim SignBmp(0)
If picSignature.Bitmap <> 0 Then
SaveImage2Byte picSignature, SignBmp, ScanCfg
SqlCommand = "UPDATE " & DBO & ".SIGNS SET UNAME=USER,UDT=CURRENT TIMESTAMP,SIGNNAME=USER,SIGNDATE=CURRENT TIMESTAMP,REC_STATUS=0 WHERE DOCTYPE = " & Doctype(lstName.ListIndex) & " AND DOC_NUM = '" & Trim$(mskDocnum.Text) & "' AND DOC_SUB = 0"
db1.Execute (SqlCommand)
SqlCommand = "SELECT SIGN_BMP FROM " & DBO & ".SIGNS WHERE DOCTYPE = " & Doctype(lstName.ListIndex) & " AND DOC_NUM = '" & Trim$(mskDocnum.Text) & "' AND DOC_SUB = 0"
'SqlCommand = "SELECT SIGN_BMP FROM SIGNS WHERE DOCTYPE = " & Doctype(lstName.ListIndex) & " AND DOC_NUM = '" & Trim$(mskDocNum.Text) & "' AND DOC_SUB = 0"
Set dsSign = db1.OpenDynaset(SqlCommand)
If UBound(SignBmp) = 0 Then
dsSign("SIGN_BMP") = Null
Else
dsSign("SIGN_BMP") = SignBmp
End If
dsSign.Update
End If
SetPointer Me, False
Exit Sub
ErrHnd:
SetPointer Me, False
ErrorMsg
End Sub
Here´s the error information
?DB1.Connection.Errors(0).Description
[IBM][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005
?DB1.Connection.Errors(0).NativeError
-99999
?DB1.Connection.Errors(0).Number
-2147217887
?DB1.Connection.Errors(0).Source
Microsoft OLE DB Provider for ODBC Drivers
?DB1.Connection.Errors(0).SQLState
22005
Can you help me?
Thanks in advance.