Tengo una aplicación que tiene el siguiente codigo:
Código Delphi
[-]
procedure TfrmRBSytemsSql.ImprimePdf(vpTabla, vpClaveFactura, vpNumFactura:string);
var
vltext : string;
begin
vltext := 'SELECT * FROM '+vptabla+' WHERE CLAVEFACTURA = '''+vpClaveFactura+''' AND NUMFACTURA = '''+vpNumFactura+'''';
try
with DModmain do
begin
if vptabla = 'MIMPOMAT' then
begin
QIMa.Sql.clear;
QIMa.Sql.Add(vltext);
QIMa.Open;
if QIMa.Isempty then exit;
end
else
if vptabla = 'MIMPOMAQ' then
begin
QIMq.Sql.clear;
QIMq.Sql.Add(vltext);
QIMq.Open;
if QIMq.Isempty then exit;
QMaq.Open;
QSeM.Open;
QSEa.Open;
QAcc.Open;
end
else
if vptabla = 'MEXPOPT' then
begin
QEPt.Sql.clear;
QEPt.Sql.Add(vltext);
QEPt.Open;
if QEPt.Isempty then exit;
end
else
begin
QEMq.Sql.clear;
QEMq.Sql.Add(vltext);
QEMq.Open;
if QEMq.Isempty then exit;
QEMaq.Open;
QSeE.Open;
QEAc.Open;
QESac.Open;
QFdaEq.Open;
end;
if frmImprimirfacturaSql = nil then
Application.CreateForm(TfrmImprimirfacturaSql, frmImprimirfacturaSql);
with frmImprimirFacturaSql do
begin
vgdesde := 1; if vptabla = 'MIMPOMAT' then tag := 1;
if vptabla = 'MIMPOMAQ' then tag := 2;
if vptabla = 'MEXPOPT' then tag := 3;
if vptabla = 'MEXPOMAQ' then tag := 4;
FormShow(nil);
ckbFacturaMexicana.Checked := False;
ckbDescargas.Checked := False;
ckbFraccionA.Checked := False;
ckbSumary.Checked := False;
ckbFacturaAmericana.Checked := True;
BitBtn2.Click;
try
vlPaginas := inttostr(vgPaginas);
except
vlPaginas := '';
end;
end;
end;
finally
vgdesde := 0;
if frmImprimirfacturaSql <> nil then
begin
frmImprimirfacturaSql.free;
frmImprimirfacturaSql := nil;
end;
end;
end;
pero me marca un error en frmImprimirfacturaSql.free;
dice que exception Eaccessviolation in module
alguien sabe que problema podria ser?