GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 2024
→
Consultancy Assistance required for WDBinaryMemo
Consultancy Assistance required for WDBinaryMemo
Iniciado por Lee SHRODER ( RL Sol, nov., 07 2020 1:43 PM - Sem resposta
Conecte-se…
Lee SHRODER ( RL Sol
#1
Membro registado
7 mensagems
Publicado em novembro, 07 2020 - 1:43 PM
Hi All,
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.
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.
The setup is as follows:-
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.
There is an offsite SQL server that has the following structure:-
DBName = TestDB
TableName = Files
Column = Picture (VarBinary(MAX)) - Also tested with an Image Type.
I am able to use SQLConnectWS to write standard text into this field so I know that the SQConnectWS functions are working.
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:-
sSQL is string
nConnect is int
sFile is string = fExeDir() + "\Happy.jpg"
IF InternetConnected () = True THEN
nConnect = SQLConnectWS ("SERVER","ODBC","USER","PASSWORD","DATABASE","OLE DB", hODBC)
IF nConnect > 0 THEN
IF FFileExist(Sfile) = True THEN
sSQL = "INSERT INTO Files VALUES ({WDBinaryMemo('" + sFile + "')})"
IF nConnect <> 0 THEN
IF SQLExec ( sSQL , "SendPIC" ) = False THEN
SQLInfo ( "SendPIC" )
Info ( SQL.MesError )
END
END
END
END
SQLClose ( "SendPic" )
SQLDisconnect ()
END
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:-
sSQL = "INSERT INTO Files VALUES ('1234')"
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.
Thank you all for any help that can be offered with this.
Kindest Regards,
Lee Shroder
Denunciar
0
0
→ Voltar para WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto