Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Image control doesn't show selected image
Message
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:
01642587
Views:
48
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:
local lcFile, lcPicVal, lnFSize, loException as exception
local array laFile[1,5]
lcFile = getfile("jpg;bmp;gif;png",'Select Seat Map Image','Select',0,'Select Image')
thisform.lBigImageSize = .f.
if not empty(m.lcFile)

	=adir(laFile, m.lcFile)
	lnFSize = laFile[1,2]
	if m.lnFSize > 1024 * 400
		lnFSize  = int(round(m.lnFSize / 1024, 0))
		if messagebox('This image is ' + alltrim(transform(m.lnFSize,'999,999,999')) + 'Kb in size!  ' + ;
				'Large images will adversely affect performance as well as storage requirements.'+chr(13)+chr(13) + ;
				'Do you want to proceed anyway?',36, 'Image size too big') <> 6

			return .f.
		else
			thisform.lBigImageSize = .t.
		endif

	endif
	try
		lcPicVal = filetostr(m.lcFile)
		replace SeatMap with m.lcPicVal in rsSeatMaps

		this.parent.imgMap.pictureval = rsSeatMaps.SeatMap

		thisform.lChangesMade = .t.
		thisform.RefreshButtons()
	catch to loException
		=messagebox('There is a problem with the selected picture: ' + loException.message + ;
			chr(13) + 'Please, re-try with a different picture...',  48, 'Problem with image')
	endtry
endif
this.parent.refresh()
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.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform