Blobs and MSSQL Server / ODBC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Blobs and MSSQL Server / ODBC

thomas....@natural-software.eu
Hello @All

I am having some trouble working with a BLOB field on a MSSQL Server database (access is via ODBC)

Table definition is with the following field definitions


ID (int, NOT NULL)
PDFData (varbinary(MAX), NULL)

When I try to retrieve data from the database, the rowdata for the PDFData field is always only one byte long.

It crashes in AbtForeignOSObject=>abtByteArrayAt:length:

where VAST tries to access more than 1 byte from the "reference" which is only one byte long.

I also tried it with a varchar(MAX) field, the crash is now in AbtForeignOSObject=>abtCharArrayAt:length:. Same thing - reference is 1-byte long. (length is correct for the string length on the database)

Any ideas?
Kind regards

Thomas

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Blobs and MSSQL Server / ODBC

thomas....@natural-software.eu
It seems to be some sort of chicken-egg problem.

The structure to load the data is defined in 

AbtCursor -> newEmptyRow

However for the varchar or varbinary fields, the length 0 is assumed. This obviously does not fit. Any ideas?? Should the row be modified later in order to create space for the data?

--
You received this message because you are subscribed to the Google Groups "VA Smalltalk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/va-smalltalk.
For more options, visit https://groups.google.com/d/optout.