Exactly...nothing seems wrong, but blob is null.
If you see, even after the insertion of the record, I can copy the exif image data to the record data, everything but the image...
What should I do...Help...
unit AvancesCod;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, hyieutils, iexBitmaps, hyiedefs,
iesettings, iexLayers, iexRulers, ieview, iemview,iexdbbitmaps, FireDAC.Stan.Intf,
FireDAC.Stan.Option, FireDAC.Stan.Param, FireDAC.Stan.Error, FireDAC.DatS,
FireDAC.Phys.Intf, FireDAC.DApt.Intf, FireDAC.Stan.Async, FireDAC.DApt,
Data.DB, FireDAC.Comp.DataSet, FireDAC.Comp.Client, cxGraphics, cxControls,
cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore, dxSkinBlack, dxSkinBlue,
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkroom, dxSkinDarkSide,
dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2013White, dxSkinOffice2016Colorful, dxSkinOffice2016Dark,
dxSkinOffice2019Colorful, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVisualStudio2013Blue,
dxSkinVisualStudio2013Dark, dxSkinVisualStudio2013Light, dxSkinVS2010,
dxSkinWhiteprint, dxSkinXmas2008Blue, dxLayoutcxEditAdapters,
dxLayoutContainer, cxContainer, cxEdit, cxStyles, cxCustomData, cxFilter,
cxData, cxDataStorage, cxNavigator, dxDateRanges, dxScrollbarAnnotations,
cxDBData, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGridLevel, cxClasses, cxGridCustomView, cxGrid, cxTextEdit, cxMaskEdit,
cxDropDownEdit, cxLookupEdit, cxDBLookupEdit, cxDBExtLookupComboBox,
dxLayoutControl, imageenview, dxLayoutControlAdapters, vcl.wwspeedbutton,
vcl.wwdbnavigator, Vcl.ExtCtrls, vcl.wwclearpanel, vcl.wwrcdpnl, ieopensavedlg;
type
TAvancesFrm = class(TForm)
ProyectosTb: TFDQuery;
Obrastb: TFDQuery;
AvancesTb: TFDQuery;
ProyectosTbCLAVE: TFDAutoIncField;
ProyectosTbNOMBRE: TWideStringField;
ProyectosDs: TDataSource;
ObrasDs: TDataSource;
AvancesDs: TDataSource;
ObrastbCLAVEOBRA: TFDAutoIncField;
ObrastbNOMBRE: TWideStringField;
ObrastbLATITUDGPS: TWideStringField;
ObrastbLONGITUDGPS: TWideStringField;
ObrastbLOCALIDAD: TWideStringField;
ObrastbPROYECTO: TIntegerField;
AvancesTbCLAVEDEAVANCE: TFDAutoIncField;
AvancesTbCLAVEDELAOBRA: TIntegerField;
AvancesTbCONCLUIDA: TBooleanField;
AvancesTbTIPODEAVANCE: TIntegerField;
dxLayoutControl1Group_Root: TdxLayoutGroup;
dxLayoutControl1: TdxLayoutControl;
cxExtLookupComboBox1: TcxExtLookupComboBox;
dxLayoutItem1: TdxLayoutItem;
dxLayoutGroup1: TdxLayoutGroup;
dxLayoutSplitterItem1: TdxLayoutSplitterItem;
cxGrid2DBTableView1: TcxGridDBTableView;
cxGrid2Level1: TcxGridLevel;
cxGrid2: TcxGrid;
dxLayoutItem3: TdxLayoutItem;
cxGridViewRepository1: TcxGridViewRepository;
cxExtLookupComboBox2: TcxExtLookupComboBox;
dxLayoutItem5: TdxLayoutItem;
dxLayoutAutoCreatedGroup2: TdxLayoutAutoCreatedGroup;
VeProyectos: TcxGridDBTableView;
VeObras: TcxGridDBTableView;
cxGrid2DBTableView1CLAVEDEAVANCE: TcxGridDBColumn;
cxGrid2DBTableView1CLAVEDELAOBRA: TcxGridDBColumn;
cxGrid2DBTableView1CONCLUIDA: TcxGridDBColumn;
cxGrid2DBTableView1TIPODEAVANCE: TcxGridDBColumn;
VeProyectosCLAVE: TcxGridDBColumn;
VeProyectosNOMBRE: TcxGridDBColumn;
VeObrasCLAVEOBRA: TcxGridDBColumn;
VeObrasNOMBRE: TcxGridDBColumn;
VeObrasLATITUDGPS: TcxGridDBColumn;
VeObrasLONGITUDGPS: TcxGridDBColumn;
VeObrasLOCALIDAD: TcxGridDBColumn;
VeObrasPROYECTO: TcxGridDBColumn;
LocalidadesTb: TFDQuery;
LocalidadesDs: TDataSource;
VeLocalidades: TcxGridDBTableView;
LocalidadesTbCLAVE: TWideStringField;
LocalidadesTbCONCATENATION: TWideStringField;
VeLocalidadesCONCATENATION: TcxGridDBColumn;
EtapasDs: TDataSource;
EtapasTb: TFDQuery;
EtapasTbCLAVEETAPA: TFDAutoIncField;
EtapasTbNOMBREDEETAPA: TWideStringField;
EtapasTbCLAVEPROYECTO: TIntegerField;
VeEtapas: TcxGridDBTableView;
VeEtapasCLAVEETAPA: TcxGridDBColumn;
VeEtapasNOMBREDEETAPA: TcxGridDBColumn;
VeEtapasCLAVEPROYECTO: TcxGridDBColumn;
FotosdeAvances: TFDQuery;
FotosdeAvanceDs: TDataSource;
FotosdeAvancesCLAVE: TFDAutoIncField;
FotosdeAvancesCLAVEDEAVANCE: TIntegerField;
FotosdeAvancesFOTO: TBlobField;
FotosdeAvancesFECHADEALTAALSISTEMA: TDateField;
FotosdeAvancesFECHADETOMADEFOTO: TDateField;
FotosdeAvancesGPSLATITUDDECIMAL: TWideStringField;
FotosdeAvancesGPSLONGITUDDECIMAL: TWideStringField;
wwRecordViewPanel1: TwwRecordViewPanel;
dxLayoutItem2: TdxLayoutItem;
dxLayoutGroup2: TdxLayoutGroup;
wwDBNavigator1: TwwDBNavigator;
dxLayoutItem6: TdxLayoutItem;
wwDBNavigator1First: TwwNavButton;
wwDBNavigator1PriorPage: TwwNavButton;
wwDBNavigator1Prior: TwwNavButton;
wwDBNavigator1Next: TwwNavButton;
wwDBNavigator1NextPage: TwwNavButton;
wwDBNavigator1Last: TwwNavButton;
wwDBNavigator1Insert: TwwNavButton;
wwDBNavigator1Delete: TwwNavButton;
wwDBNavigator1Edit: TwwNavButton;
wwDBNavigator1Post: TwwNavButton;
wwDBNavigator1Cancel: TwwNavButton;
wwDBNavigator1Refresh: TwwNavButton;
wwDBNavigator1SaveBookmark: TwwNavButton;
wwDBNavigator1RestoreBookmark: TwwNavButton;
Abreimagen: TOpenImageEnDialog;
Mirafotos: TImageEnView;
dxLayoutItem4: TdxLayoutItem;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FotosdeAvancesAfterInsert(DataSet: TDataSet);
private
{ Private declarations }
public
{ Public declarations }
end;
var
mifoto:TIEDBBitmap;
AvancesFrm: TAvancesFrm;
implementation
{$R *.dfm}
uses DatosGeneralCod;
procedure TAvancesFrm.FormCreate(Sender: TObject);
begin
datosgeneral.abretabla(etapastb);
datosgeneral.abretabla(localidadestb);
DatosGeneral.abretabla(PROYECTOSTB);
DATOSGENERAL.abretabla(OBRASTB);
DATOSGENERAL.abretabla(AVANCESTB);
datosgeneral.abretabla(fotosdeavances);
mifoto := TIEDBBitmap.Create(FotosdeAvanceDs,'FOTO','');
MIFOTO.AutoLoad:=TRUE;
mirafotos.AutoToolbars:=
[ievViewing];
mirafotos.SetExternalBitmap( mifoto );
end;
procedure TAvancesFrm.FormDestroy(Sender: TObject);
begin
freeandnil(mifoto);
end;
procedure TAvancesFrm.FotosdeAvancesAfterInsert(DataSet: TDataSet);
begin
if abreimagen.Execute then
begin
mirafotos.IO.LoadFromFile(abreimagen.FileNameW);
with mirafotos.IO.Params do
if exif_hasexifdata then
begin
FotosdeAvancesFECHADETOMADEFOTO.Value:=
EXIF_DateTime2;
FotosdeAvancesGPSLATITUDDECIMAL.Value:=
EXIF_GPSLatitude.ToString;
FotosdeAvancesGPSLONGITUDDECIMAL.Value:=
exif_gpslongitude.ToString;
end;
end
else
fotosdeavances.Cancel;
end;
end.