Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Storing An Image In A SQL Table
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
01234808
Message ID:
01234871
Vues:
26
You should map SQL Image column to VFP blob data type in the remote view.
Check also CURSORSETPROP("MapBinary") in the help.

>It is an Image file in SQL. It appears to be working with this. Should I make the SQL column a 'blob'?
>
>
>
>CLOSE DATABASES ALL
>MODIFY DATABASE ImageLoad.DBC NOWAIT
>
>cImageFile = "graphics\test_image.bmp"
>
>IF USED("v_ImageTest")
>	USE IN v_ImageTest
>ENDIF
>
>SELECT 0
>USE v_ImageTest
>
>FOR nRecord = 1 TO 1000
>
>	WAIT WINDOW "Adding record " + TRANSFORM(nRecord) + " of 1000" NOWAIT
>
>	cImageName = SYS(2015)
>
>	INSERT INTO v_ImageTest;
>		(ImageName);
>		VALUES;
>		(cImageName)
>
>	APPEND MEMO ImageFile FROM &cImageFile OVERWRITE
>
>ENDFOR
>
>RETURN
>
>
>
>Now I want to pull the images out, and I'm trying:
>
>
>nHandle = SQLSTRINGCONNECT(cConnString)
>
>IF nHandle > -1
>SET STEP ON
>	nResult = SQLEXEC(nHandle, "select * from ImageTest", "Images")
>	
>	IF nResult > -1
>	
>		cImageFile = STRTOFILE(Images.ImageFile, cDestDir + Images.ImageName + ".bmp")
>		
>	ELSE
>		? "Error"
>	ENDIF
>	
>	SQLDISCONNECT(nHandle)
>
>ELSE
>	? "Not connected"
>ENDIF
>
>
>When I get the resulting cursor back, the Gen field appears empty. When I attempt to open the Gen field,
>I get "OLE object is invalid or corrupted."
>
>What in the world am I doing wrong here?
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform