PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → SQLOLEDB connection – restore the value of VARCHAR(MAX) results in zero length file
SQLOLEDB connection – restore the value of VARCHAR(MAX) results in zero length file
Débuté par vvido, 07 mai 2021 11:40 - 2 réponses
Membre enregistré
94 messages
Posté le 07 mai 2021 - 11:40
I have a problem with reading a memo from MSSQL database.

A MSSQL table has a VARCHAR(MAX) field. In the analysis the field is declared as sound/image/binary.

STEP 1 - Saving a file to a field in the MSSQL database (this works)
--------------------------------------------------------------------------------------
HLinkMemo and HAdd works without error.
The size of the field in the database is CORRECT - the SAME size as the size of the file being saved (checked the size in Microsoft SQL Server managment Studio)

STEP 2 - Reading the content of the memo results in file with ZERO bytes.
--------------------------------------------------------------------------------------------------------
HReadSeekFirst finds the correct record (checked with debugger)
HExtractMemo = TRUE -- no error
- the file is created
- the size of the file is zero

I do not know what I am doing wrong. I assume that this is supported with SQLOLEDB connection.
Posté le 14 mai 2021 - 16:23
did you try wit another kind of connection?
like native acesss ou odbc

Carlos lages
Membre enregistré
94 messages
Posté le 20 mai 2021 - 09:48
Thanks for the hint.

I have solved the problem by changing the column definition in the database to VARBINARY(max).

But still inthe varchar case -- Windev runtime library failed to return the error - this is a serious weakness of PCSoft runtime library.
I did not get any valuable information from the tech support.

The field was saved correctly, I have made a test with a different development tool (Clarion) and the file was saved correctly !