Hello.

I'm having a problem within my VB6 application. I have to update a BLOB column in a DB2 table and face a very curious problem. I have tried it with 2 different tables (Create table a (id decimal(10), data blob); Create table b (id decimal(10), data long varchar for bit data), 2 different conection strings and with the option LONGDATACOMPAT=1 in the DB2cli.ini file.
When I'm using the IBMDADB2 Provider or the ODBC conection with the LONGDATACOMPAT option I'm getting the error [DB2/NT] SQL0204N "TEST.a" is an undefined name. SQLSTATE=42704. This error occurs at the 'call rs.update' statement. The 'rs.open' statement works correct. Very strange errormessage. When I remove the LONGDATACOMPAT option I get the error [IBM][CLI Driver] CLI0102E Invalid conversion. SQLSTATE=07006.

Sourcecode:
Option Explicit
Private Con As New ADODB.Connection

Private Const connstr_prefix = "Provider=IBMDADB2;Database=TZITTEST;HOSTNAME=AT01 0000SAD03.at.Top.com; PROTOCOL=TCPIP;PORT=50000"
'Private Const connstr_prefix = "DSN=TZITTEST"


Private Sub Command1_Click()
Dim scon As String
Dim cmd As New ADODB.Command
Dim rs As ADODB.Recordset
Dim blob As ADODB.Stream

On Error GoTo myError
Con.ConnectionString = connstr_prefix & ";UID = myUser; Pwd=myPwd"
Con.Mode = adModeReadWrite
Con.CursorLocation = adUseClient
Call Con.Open

Set blob = New ADODB.Stream
blob.Type = adTypeBinary
Call blob.Open
Call blob.LoadFromFile("c:\xx.ddl")
cmd.ActiveConnection = Con
cmd.CommandText = "set schema test"
Set rs = cmd.Execute
cmd.CommandText = "select ID, DATA from a where ID=1"
Set rs = New ADODB.Recordset
rs.CursorLocation = adUseClient
Call rs.Open(cmd.CommandText, cmd.ActiveConnection, adOpenStatic, adLockOptimistic, adCmdText)
rs.Fields(1) = blob.Read
Call rs.Update
Call rs.Close
Call blob.Close
Call Con.Close
myError:
Con.Close
Call MsgBox(Err.Description)
End Sub

So I would be happy if someone could help me in that case. Probably there are additional ways to get data into a DB2 BLOB.

lg Klaus