Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2002
    Location
    Argentina
    Posts
    3

    Unanswered: Blob Recordset Update Fails - ADO 2.1 - ODBC - CLI0112E - Error in assignment

    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.

  2. #2
    Join Date
    Dec 2001
    Location
    Barcelona
    Posts
    32
    what type of cursor are you using?

  3. #3
    Join Date
    Jan 2002
    Location
    Argentina
    Posts
    3
    Originally posted by daboira
    what type of cursor are you using?
    Originally posted by daboira
    what type of cursor are you using?
    Oh!, the type of cursor i´m using is not visible beacuse I use a class.

    here it´s:

    Public Sub OpenDynaset(Name As String)

    Set rs = New ADODB.Recordset
    Set rs.ActiveConnection = ADOConn
    rs.CursorLocation = adUseClient
    rs.CursorType = adOpenKeyset
    rs.LockType = adLockPessimistic
    rs.Open Name
    ' Set rs.ActiveConnection = Nothing

    End Sub

    you can see I´m using keyset cursor with useclient location.


    I hope you can help me!

    Thank´s Deboira.

  4. #4
    Join Date
    Dec 2001
    Location
    Barcelona
    Posts
    32
    From Ado to AS400 with Client Access (I think the best driver in this situation) there are some problems to read/save blob fields. Any read to the table (to know if you have the register or not) needs a client cursor. At the same time if you want update or add a register in a table with a BLOB field you need a server cursor.
    I hope this helps you.

  5. #5
    Join Date
    Jan 2002
    Location
    Argentina
    Posts
    3
    Originally posted by daboira
    From Ado to AS400 with Client Access (I think the best driver in this situation) there are some problems to read/save blob fields. Any read to the table (to know if you have the register or not) needs a client cursor. At the same time if you want update or add a register in a table with a BLOB field you need a server cursor.
    I hope this helps you.
    Than´s deboira. I will try it. but...
    I think the recordset updates are always clientside...
    I don´t remember if readed client cursor and keyset cursort type (updates) are not compatible.

    Podemos hablar en castellano acá?


    Bruno.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •