Page 1 of 1

Error using UniDac and Postgresql

Posted: Thu 08 Apr 2021 09:00
by Ole Ekerhovd
There are still errors using version 8.4.2 and 8.4.3 The error occurres when posting Blobs. Here is my code, it works fine in version 8.3.2.

Error is Access violation.

procedure TfrmSkanneDocument.SaveDocument(dokumenttype : string; Nummeret : integer);
var

ms : TMemorystream;
i : integer;
begin

ms:=TMemorystream.create;

tiffviserd.MIO.SaveTostreamtiff(ms,false);

try

screen.cursor:=crsqlwait;

dataene.Lagre.SQL.Clear;
dataene.lagre.sql.add('INSERT INTO dokumenter');
dataene.lagre.sql.add('(Nummer,Dokumenttype,Navn,Tilhorer,Dato,Bilde,Privat,Askpassord,Bildenummer,Skalikkeslettes)');
dataene.lagre.sql.add('VALUES(:pNummer,:pDokumenttype,:pNavn,:pTilhorer,:pDato,:pBilde,:pPrivat,:pAskpassord,:pBildenummer,:pSkalikkeslettes)');
dataene.lagre.ParamByName('pNummer').asinteger:=nummeret;
dataene.lagre.ParamByName('pDokumenttype').asstring:=dokumenttype;
dataene.lagre.ParamByName('pNavn').asstring:=txtbeskrivelse.Text;
dataene.lagre.ParamByName('pTilhorer').asstring:=bruker.Pologget;
dataene.lagre.ParamByName('pDato').asdatetime:=txtdato.date;
dataene.lagre.ParamByName('pBilde').setblobdata(ms.Memory,ms.size);
dataene.lagre.ParamByName('pPrivat').asboolean:=chkprivat.Checked;
dataene.lagre.ParamByName('pAskpassord').asboolean:=chkaskpassord.Checked;
dataene.lagre.ParamByName('pSkalikkeslettes').asboolean:=chkskalikkeslettes.Checked;
dataene.lagre.ParamByName('pBildenummer').asinteger:=tiffviserd.ImageCount-1;

dataene.lagre.Execute;

finally
ms.Free;
screen.Cursor:=crdefault;
end;

end;

Regards,
Ole

Re: Error using UniDac and Postgresql

Posted: Tue 13 Apr 2021 09:14
by oleg0k
Hello,
Unfortunately, we couldn't reproduce the issue.
Please send us an example that uses UniDAC and demonstrates the incorrect behavior, along with DDL scripts for creating and populating the database objects. Please send them through the form on our website: https://devart.com/company/contactform.html

wbr, Oleg
Devart Team

Re: Error using UniDac and Postgresql

Posted: Mon 03 May 2021 04:53
by vampirekb
dataene.lagre.ParamByName('pBilde').setblobdata(ms.Memory,ms.size);

try to make
LoadFrom Stream(ms,ftBLOB);

I use it at 8.3.2 but stil lscary to install 8.4 , so i'll wait for your responce ))

Re: Error using UniDac and Postgresql

Posted: Mon 03 May 2021 10:44
by Frank2021
I can confirm that the problem exists.
My collegs test this with 8.4.3.
Now we still use 8.3.2.

Best regards
Frank

Re: Error using UniDac and Postgresql

Posted: Thu 13 May 2021 12:18
by MaximG
We haven't yet received any files from you. Could you please resend the sample project?