CLOSE DATABASES ALL MODIFY DATABASE ImageLoad.DBC NOWAIT IF USED("v_GenImages") USE IN v_GenImages ENDIF SELECT 0 USE v_GenImages DELETE FROM v_GenImages nTotImages = ADIR(aImages, "Images\*.png") FOR nImage = 1 TO nTotImages cImageName = LOWER(SYS(5) + SYS(2003) + "\Images\" + aImages[nImage, 1]) INSERT INTO v_GenImages; (imagesize, imagecode); VALUES; (16, LOWER(JUSTSTEM(cImageName))) REPLACE ImageFile WITH FILETOSTR(cImageName) ENDFORThat part worked fine. This next part errors on the STRTOFILE() with "Function argument value, type, or count is invalid."
nHandle = SQLSTRINGCONNECT(cConnString) IF nHandle > -1 nResult = SQLEXEC(nHandle, "select * from genimages", "Images") IF nResult > -1 SELECT Images SCAN cFileName = cDestDir + ALLTRIM(Images.ImageCode) + ".png" =STRTOFILE(ImageFile , JUSTFNAME(cFileName)) ENDSCAN ELSE ? "Error" ENDIF SQLDISCONNECT(nHandle) ELSE ? "Not connected" ENDIFThis was all working the last time I posted on this. Now I can't get the images back outta
>>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 >>>>
>>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 >>>>