Hi,
With last version of Unidac 11.0.1 and delphi 13 (september and october patch installed), i've this error when adding blob in virtualquery :
Le projet MSat5.exe a déclenché la classe d'exception EAssertionFailed avec le message 'TBlob.Free RefCount = 0 (D:\Jenkins\workspace\DAC\UniDAC\Delphi\Dac\Common\Source\MemData.pas, ligne 10248)'.
With the code below :
if (Sender as TscGPGlyphButton).Tag = 1 then //---- Ajout
aForm := TFicheAutreDocumentReunion.Create(Self,RE_ID,-1,Titre.Text,VQ)
else //---- Modification
aForm := TFicheAutreDocumentReunion.Create(Self,RE_ID,RequeteDoc.FieldByName('DR_ID').AsInteger,'',VQ);
try
//---- Cache la fenêtre d'appel
ShowWindow(Self.Handle,SW_HIDE);
//---- Affichage
if aForm.ShowModal = mrOk then
begin
if (Sender as TscGPGlyphButton).Tag = 1 then //---- Ajout
begin
DR_ID := AutoIncDocReunion;
VQ.Sql.Text := 'INSERT INTO T_DOC_REUNION (DR_EXTENSION,DR_DATE,DR_SOURCE,DR_LIBELLE,DR_ORIGINAL,RE_ID,DR_ID,DR_FILE) VALUES (:DR_EXTENSION,:DR_DATE,:DR_SOURCE,:DR_LIBELLE,:DR_ORIGINAL,:RE_ID,:DR_ID,:DR_FILE)'
end
else
begin
DR_ID := RequeteDoc.FieldByName('DR_ID').AsInteger;
VQ.Sql.Text := 'UPDATE T_DOC_REUNION SET DR_EXTENSION = :DR_EXTENSION,DR_DATE = :DR_DATE,DR_SOURCE = :DR_SOURCE,DR_LIBELLE = :DR_LIBELLE' + ',DR_ORIGINAL = :DR_ORIGINAL,DR_FILE = :DR_FILE WHERE (RE_ID = :RE_ID) AND (DR_ID = :DR_ID)';
end;
//---- Types
VQ.Params[0].DataType := ftString; //---- DR_EXTENSION
VQ.Params[1].DataType := ftDateTime; //---- DR_DATE
VQ.Params[2].DataType := ftString; //---- DR_SOURCE
VQ.Params[3].DataType := ftString; //---- DR_LIBELLE
VQ.Params[4].DataType := ftString; //---- DR_ORIGINAL
if (Sender as TscGPGlyphButton).Tag = 1 then //---- Ajout
begin
VQ.Params[5].DataType := ftInteger; //---- RE_ID
VQ.Params[6].DataType := ftInteger; //---- DR_ID
VQ.Params[7].DataType := ftBlob; //---- DR_FILE
end
else
begin
VQ.Params[5].DataType := ftBlob; //---- DR_FILE
VQ.Params[6].DataType := ftInteger; //---- RE_ID
VQ.Params[7].DataType := ftInteger; //---- DR_ID
end;
//---- Valeurs
VQ.Params[0].AsString := aForm.GetExt; //---- DR_EXTENSION
if aForm.DateD.IsDateInput then
VQ.Params[1].AsDateTime := aForm.DateD.Date //---- DR_DATE
else
VQ.Params[1].Clear; //---- DR_DATE
VQ.Params[2].AsString := aForm.Source.Text; //---- DR_SOURCE
VQ.Params[3].AsString := aForm.Nom.Text; //---- DR_LIBELLE
VQ.Params[4].AsString := aForm.Original.Caption; //---- DR_ORIGINAL
if (Sender as TscGPGlyphButton).Tag = 1 then //---- Ajout
begin
VQ.Params[5].AsInteger := RE_ID; //---- RE_ID
VQ.Params[6].AsInteger := DR_ID; //---- DR_ID
VQ.Params[7].LoadFromFile(_GetWindowsTemp + 'DOC_REUNION' + GetExtLocal(aForm.Original.Caption,aForm.GetExt),ftBlob); //---- DR_FILE
end
else
begin
VQ.Params[5].LoadFromFile(_GetWindowsTemp + 'DOC_REUNION' + GetExtLocal(aForm.Original.Caption,aForm.GetExt),ftBlob); //---- DR_FILE
VQ.Params[6].AsInteger := RE_ID; //---- RE_ID
VQ.Params[7].AsInteger := DR_ID; //---- DR_ID
end;
try
//---- Validation
VQ.ExecSQL;
//---- Mise à jour
RefreshVirtDataSet(RequeteDoc);
except on E: Exception do
ShowErrorAndFocus(Format('Erreur d''enregistrement (%s)',[E.Message]),nil);
end;
end;
Any Ideas ?
Regards.