I have a problem with compiling in Delphi 12 with UniDAC 10.0.0. Everything works in Delphi 11 with UniDac 9.4.0. Database is Postgres.
When I want to insert the current time into a table item that is of the timestamp type using the Now function, an error occurs date/time field value out of range : "2023-11-25 18:1344:25.442000+01".
When I don't use the Now function, but the Date function, where only the date is returned, everything works correctly.
Here is a simple example:
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, cxGraphics, cxControls, cxLookAndFeels,
cxLookAndFeelPainters, dxSkinsCore, dxSkinBasic, 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,
dxSkinOffice2019Black, dxSkinOffice2019Colorful, dxSkinOffice2019DarkGray,
dxSkinOffice2019White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringtime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinTheBezier, dxSkinValentine,
dxSkinVisualStudio2013Blue, dxSkinVisualStudio2013Dark,
dxSkinVisualStudio2013Light, dxSkinVS2010, dxSkinWhiteprint, dxSkinWXI,
dxSkinXmas2008Blue, cxStyles, cxCustomData, cxFilter, cxData, cxDataStorage,
cxEdit, cxNavigator, dxDateRanges, dxScrollbarAnnotations, Data.DB, cxDBData,
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, DBAccess, Uni,
cxGridLevel, cxClasses, cxGridCustomView, cxGrid, Vcl.StdCtrls, MemDS,
UniProvider, PostgreSQLUniProvider;
type
TForm1 = class(TForm)
UniConnection1: TUniConnection;
UniQuery1: TUniQuery;
Button1: TButton;
cxGrid1DBTableView1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
cxGrid1: TcxGrid;
UniDataSource1: TUniDataSource;
cxGrid1DBTableView1sklad_id: TcxGridDBColumn;
cxGrid1DBTableView1nazev: TcxGridDBColumn;
cxGrid1DBTableView1d_zmeny: TcxGridDBColumn;
cxGrid1DBTableView1uzivatel_id: TcxGridDBColumn;
PostgreSQLUniProvider1: TPostgreSQLUniProvider;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
UniQuery1.Insert;
UniQuery1.FieldByName('nazev').AsString := 'test';
UniQuery1.FieldByName('d_zmeny').AsDateTime := Now;
UniQuery1.FieldByName('uzivatel_id').Value := 25;
UniQuery1.Post;
end;
end.