win95, vb4 pro 32bit, sybase 10, intersolv odbc, addchunk (image blobs) 
Author Message
 win95, vb4 pro 32bit, sybase 10, intersolv odbc, addchunk (image blobs)
I'm trying to read an image from a file on the PC into a
sybase image blob.

I'm using Win95, vb4 pro 32bit, sybase system 10, and the
intersolv odbc driver.

I would like to hear from anyone who has been able to write
blobs to Sybase in this environment!

I can't seem to get addchunk to work. I think my configuration
is OK, because I can read large blobs from Sybase using
getchunk.

When I try to write blobs to the database (using code
very similar to the addchunk examples in the manual) my code
executes without causing any VB errors, but only a small
blob is written to the database. When I send around 59000
bytes, sybase receives only 250 bytes.

The differences between my code and the addchunk example
are as follows:

Instead of using a string buffer (which doesn't work in
32bit VB4), I'm using a dynamically allocated array of bytes:
        Dim buffer() as byte
appears at the beginning of the routine,
        redim buffer(chunkSize)
before the first use, and
        redim buffer(remainingSize)
is done for the last buffer. This works well for getchunk.

Instead of reading the existing blob into an array of strings,
I do
        myBlob.getchunk buffer                  (***)

        myRecordset.Edit
        while remainingSize > 0
                get buffer from file
                myBlob.addchunk buffer
        wend
        myRecordset.Update
        myRecordset.Close

The getchunk at (***) seems to be necessary, even though
I don't use the data. If it isn't done, the Update
fails (perhaps because the lower level software did
not get a valid textptr?)

Perhaps addchunk calculates the size incorrectly because
the byte() buffer is used instead of a string?
I tried using a string variable, and the same problem
occurs.

To me, this seems to be a bug in the Intersolv ODBC driver.
Is this is a known bug? Are fixes available?



Wed, 29 Jul 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. vb4 RDO, intersolv odbc, and Sybase system 10

2. Installing Sybase 10 ODBC for windows under WIN95

3. VB, ODBC, Sybase System 10, and Dynamic (real) SQL

4. VB 4.0 and the 32-bit ODBC for Sybase System 10

5. VB->ODBC->Sybase 10 on NetWare ?

6. VB 4.0 and the 32-bit ODBC for Sybase System 10

7. Sybase ASE ODBC driver ( version 3.50.00.10 ) and Crystal Reports 4.6 error

8. Sybase system 10, ODBC, RDO, VB5

9. VB4(16) & Sybase System 10 OpenRecordset problem

10. VB4-32bit/Win95 Oracle ODBC problems.

11. VB4/Sybase System 10

12. VB4.0 & Sybase Sys 10 Connect stmt

 

 
Powered by phpBB® Forum Software