Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image control doesn't show selected image
Message
From
01/11/2016 08:46:41
 
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Database:
MS SQL Server
Miscellaneous
Thread ID:
01642403
Message ID:
01642590
Views:
42
>I connected to the customer's computer which is Windows Server 2012 R2.
>
>I can see the problem with varbinary(max) columns.
>
>We tried to install different SQL Server drivers (Driver for SQL Server 2014 - version 12 and version 13). Both didn't work - I see the same problem.
>
>The SQL Server driver is version 6. I didn't find download for version 10 I have. I am not sure it'll fix the problem.
>
>Do you have ideas for the solution?
>
>Here is the code in the Load method of the form (beginning):
>
>
>do set_setup
>cursorsetprop("MapBinary", .t., 0) && Maps image/varbinary(max) fields to blob in VFP
>_vfp.autoyield = .f.
>* http://www.bennet-tec.com/compatibility.htm#FoxPro
>set deleted on
>set notify off
>
>This is a button to upload image:
>
> [snip]
>
>
>I see no exception message. The SQL Server row shows correct value for the image. Just the image control doesn't display the image.
>
>Do you know what should I try?
>
>This is very important problem and I don't really have ideas what to try next.

Naomi, the attached images report the effect of different mapping status for varchar and varbinary (the one that's interesting you) using an "SQL Server" ODBC driver, version 6.01.7601.17514.

For the first image,
CURSORSETPROP("MapBinary",.T.,0)
CURSORSETPROP("MapVarchar",.T.,0)
and VFP maps the SQL column contents to a Blob field, while for the second, mappings are set to false and VFP retrieves the SQL data into a General field. That is, setting the mappings properly will allow to set the image in the control.

You already checked on the image file itself, haven't you? You already verified that you can use the file your customer is trying to upload in a regular VFP image control, right?
----------------------------------
António Tavares Lopes
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform