Subject Inserting/updating blobs using MS ADODB
Author h_urlaf
Hi all,

is there anyone around that could provide me with a full working
sample of inserting and updating blobs using adodb (including the name
of the driver used)? I found some code samples in the VB list that I
tried to use, with the '{Firebird/Interbase(r) Driver}', '{XTG Systems
InterBase6 ODBC driver}' and the 'ZStyle IBOLE Provider'.

(cmd is an ADODB.Command)

** The 'Firebird/Interbase' driver crashes when I try to do

rs.Open "SELECT * FROM DOCUMENT WHERE 1=0", firebird, adOpenDynamic,
adLockOptimistic
rs.AddNew
firebird.BeginTrans
rs.fields.Item("DOCUMENT_SIZE") = fStream.size
rs.fields.Item("DOCUMENT").AppendChunk (fStream.Read)
rs.Update ' **** it crashes hard on this. ****

When I change it to

cmd.ActiveConnection = firebird
cmd.CommandText = "INSERT INTO DOCUMENT DOCUMENT, DOCUMENT_SIZE
VALUES (?, ?)"
cmd.Parameters.Refresh

cmd.Parameters(0) = fStream.Read
cmd.Parameters(1) = fSize
firebird.BeginTrans
cmd.Execute ' **** says "type is invalid here" ****

** With the XTG driver, when I do the following:

cmd.CommandText = "INSERT INTO USERS " & _
"(USER_ID, USER_NAME, PASSWORD_HASH, EMAIL_ADDRESS) " & _
"VALUES (?, ?, ?, ?)"
cmd.Parameters.Refresh
cmd.Parameters(0) = userid

I get "Item cannot be found in the collection corresponding to the
requested name or ordinal" at the assignment in the last line

** With the ZStyle driver, with the same code as the XTG driver, I get
past the assignment, but at the cmd.execute I get "Unsupported
feature"