Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > DB2 > Blob Recordset Update Fails - ADO 2.1 - ODBC - CLI0112E - Error in assignment

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-17-02, 13:49
bmasotta bmasotta is offline
Registered User
 
Join Date: Jan 2002
Location: Argentina
Posts: 3
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.
Reply With Quote
  #2 (permalink)  
Old 01-18-02, 08:29
daboira daboira is offline
Registered User
 
Join Date: Dec 2001
Location: Barcelona
Posts: 32
what type of cursor are you using?
Reply With Quote
  #3 (permalink)  
Old 01-18-02, 13:43
bmasotta bmasotta is offline
Registered User
 
Join Date: Jan 2002
Location: Argentina
Posts: 3
Quote:
Originally posted by daboira
what type of cursor are you using?

Quote:
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.
Reply With Quote
  #4 (permalink)  
Old 01-21-02, 05:34
daboira daboira is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 01-23-02, 14:04
bmasotta bmasotta is offline
Registered User
 
Join Date: Jan 2002
Location: Argentina
Posts: 3
Quote:
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On