I’ve tried using NativeValue but Xojo thinks it’s a string. I think this is the problem. What is Xojo doing with an “Image” datatype from SQL? Why is it a string?
If it is a string, how do I get to the Native BLOB data? Can I decode it somehow?
What code did you try? NativeValue should be returning a Nil-encoded String, which is essentially just a collection of bytes. Does that not work with the WebPicture constructor? Does it work with the constructor if you assign it to a MemoryBlock first? Is it a valid JPEG if you save the NativeFile to a file on the drive?
the recommendation for storing images in SQL 2008+ would be Varbinary(max) as data type image is being depreciated. With this said, based on the forum thread you provide, this would indicate that it maybe related.
a few thoughts here. does the image have to be stored in the database or can you store it on the File System and have a database file pointer to the image to load into the web app?
Another thought is, if you try ODBC… do you get the same results?
I’ve tried converting the Image datatype to Varbinary(max) in my stored procedure but to no avail. I’ve also tried converting the Varbinary(max) value to varchar(max) but that still only returns 26 bytes!
The database is an existing one with a ASP.NET website populating the data which I can’t modify. So I have to read the data from the database.