Crash on Windows on Reading Blob

Using Postgres 9.1 and Xojo 2014 r2.1, I am getting a very consistent crash on the following line but only on Windows (all versions, compiled and debug), never on Mac:

If (Len(rs.Field"Picture".stringvalue) > 0) then //Do Something End if

The error is:

[quote]The instruction at 0x773f60d9 referenced memory at 0x065dc4ac. The memory could not be written.
Click on OK to terminate the program.[/quote]

Any ideas as to what might be causing this crash?

can you put it in a variable first?
Maybe check the string in debugger. Could be some problem?

does lenB work better? Not that Len tries to parse it as UTF-8.

Seems like there is something related to the data in that field that is causing the crash.

The crash also occurs when replaced with:

Dim s as String = rs.Field("Picture").stringValue

Using LenB did not help.

The field is hex encoded because it is a bytea blob field in PostgreSQL, so it is basically just a string.
When I look at the contents of the data using pgAdmin 3, it is just a string of characters:

“\377\330\377\340\000\020JFIF\000\001\001\000\000\001\000\001\000\000\377\355\000XPhotoshop 3.0\0008BIM\004\004\000\000\000\000\000\037\034\001Z\000\003\033%G\034\002\000\000\002\000\002\034\002\031\000\013Photo Booth\0008BIM\004%\000\000\000\000\000\020qyd (…)”

When I examine the field using Navicat (Mac OS), the photo is displayed.

Just to see if I was going crazy, I installed pgAdmin on the Windows machine and was able to load the data from the record that is causing the crash in the Xojo app.

Not sure why specifically this causes a hard crash on any Windows machine while in Mac OS it is stable.

Any other ideas?

Put a breakpoint on that “if” line and inspect the recordset. I’m curious if it actually contains a picture field.

OK, this is now starting to get interesting. I pause the method at the “if” statement, then examine the recordset.

On the Mac, the contents of the picture field is displayed in hex encoded format.

On Windows, when I hit the Contents link, the Xojo IDE crashes (consistently and repeatedly).

you could try the MBS SQL Plugin as an alternative…

[quote=157360:@David Schlam]OK, this is now starting to get interesting. I pause the method at the “if” statement, then examine the recordset.

On the Mac, the contents of the picture field is displayed in hex encoded format.

On Windows, when I hit the Contents link, the Xojo IDE crashes (consistently and repeatedly).[/quote]

Please file a bug report so that we can fix this.

Sure, how do I do that?

In the meantime, I downloaded the upgrade (version 2014 r3.1) just to see (since there was a newer version of Xojo available, it was worth a try, right?). When I hit RUN, the project appears to compile but never launches. Seems like my license is installed and active.

Restarted the computer, removed and reinstalled the update, turned off any virus protection - still not working. What do you think?

Nevermind. Found it.

Is there a way to test the compatibility of this plugin before you buy?

use them in demo mode and see if things work.