<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><category>pcsoft.us.windev</category><copyright>Copyright 2026, PC SOFT</copyright><lastBuildDate>7 Nov 2020 13:43:22 Z</lastBuildDate><pubDate>7 Nov 2020 13:43:22 Z</pubDate><description>Hi All,&#13;
&#13;
	I am looking for someone to offer me some consultancy to get a function working for uploading an image into a MSSQL server database using SQLConnectWS and WDBinaryMemo.&#13;
&#13;
The task should be simple but for some reason I can't seem to get it to work and I have been trying for a while now.&#13;
&#13;
The setup is as follows:-&#13;
&#13;
There is a JPG file located in the EXE directory called Happy.jpg, and I am using Windev 25 to create a simple window with one button to run the code.&#13;
There is an offsite SQL server that has the following structure:-&#13;
&#13;
DBName = TestDB&#13;
TableName = Files&#13;
Column = Picture (VarBinary(MAX))   -  Also tested with an Image Type.&#13;
&#13;
I am able to use SQLConnectWS to write standard text into this field so I know that the SQConnectWS functions are working.&#13;
&#13;
Here is the code I am trying to use to send the image, please note that I have replaced the connection string info so as not to publicly detail how to connect:-&#13;
&#13;
sSQL          is string &#13;
nConnect      is int &#13;
sFile         is string = fExeDir() + "\Happy.jpg"&#13;
&#13;
IF InternetConnected () = True THEN &#13;
       &#13;
       nConnect = SQLConnectWS ("SERVER","ODBC","USER","PASSWORD","DATABASE","OLE DB", hODBC) &#13;
       &#13;
       IF nConnect &gt; 0 THEN               &#13;
              &#13;
		IF FFileExist(Sfile) = True THEN&#13;
&#13;
  	         	sSQL  = "INSERT INTO Files VALUES ({WDBinaryMemo('" + sFile + "')})"&#13;
              &#13;
  	           	IF nConnect &lt;&gt; 0 THEN &#13;
                     &#13;
       			     	IF SQLExec ( sSQL , "SendPIC" ) = False THEN &#13;
                           &#13;
        	                    SQLInfo ( "SendPIC" ) &#13;
                	           Info ( SQL.MesError ) &#13;
                           &#13;
                   		END                  &#13;
                     &#13;
              		END                                                    &#13;
&#13;
		END&#13;
&#13;
       END &#13;
       &#13;
       SQLClose ( "SendPic" ) &#13;
       SQLDisconnect ()      &#13;
              &#13;
END &#13;
&#13;
This always results in an empty SQL.MesError result failure and I have tried a various different variants of the command with no success.  If I replace the SQL string to the following command I can write to the database successfully:-&#13;
&#13;
sSQL  = "INSERT INTO Files VALUES ('1234')"&#13;
&#13;
So the issue seems to be around the WDBinaryMemo function, as detailed I am willing to pay for a couple hours of consultancy with remote access to my development platform to resolve this and welcome any suggestions to its resolution.&#13;
&#13;
Thank you all for any help that can be offered with this.&#13;
&#13;
&#13;
Kindest Regards,&#13;
&#13;
Lee Shroder</description><ttl>30</ttl><generator>WEBDEV</generator><language>en_US</language><link>https://forum.pcsoft.fr/es-ES/pcsoft.us.windev/68084-consultancy-assistance-required-for-wdbinarymemo/read.awp</link><title>Consultancy Assistance required for WDBinaryMemo</title><managingEditor>moderateur@pcsoft.fr (El moderador)</managingEditor><webMaster>webmaster@pcsoft.fr (El webmaster)</webMaster></channel></rss>
