I have a SQL table with an image field. The table is linked to an Access mdb
and I write to it using VBA code. We were writing new data to the image
field with the appendchunk VBA method. The data was PDF (acrobat files).
Worked fine for several months. Then had a requirement to put jpg files in
the same field. Tried using same code to appendchunk a byte array that now
contained the jpg file bytes instead of PDF files. It fails. We get an ODBC
driver error 3157. None of the conditions that would cause that error exist.
We do a test on another table with similar data structure. It works!
We realize that the only difference between the table in which we can import
and the other one that fails is that the one that fails has a primary key
constraint. We remove the primary key constraint and replace it with a
unique index and guess what. The inserts and updates to the table now work
ok.
Now problem is , previously we had immediate synchronization with another
table on another server working fine via replication. That replicated table
had no PK constraint. Now the replicated table does not get updated
anymore.
Now what the hey would a PKconstraint have to do with being able to update
another field or not using appendchunk when the only difference between what
works and what doesn't is the contents of the byte array being saved? The
jpg files were bigger than the PDF files but so what?
I just LOVE this sh......! <GGGGGGG> ;-)
--
Robert Dufour, MCP, MCT
President SGI IMS Inc.
www.sgiims.com