Forum > Databases
[SOLVED - Pleas ignore]How to use ApplyUpdates in IBX
(1/1)
incendio:
Hi guys,
Newbie here, I tried to use IBX for my database application.
I have codes declaration like these
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} --- TForm1 = class(TForm) btnUndo: TButton; btnSave: TButton; DataSource1: TDataSource; Dba: TIBDatabase; DBEdit1: TDBEdit; DBText1: TDBText; Dt: TIBDataSet; DtCD: TIBStringField; DtGRP: TIBStringField; DtID: TIBIntegerField; Trs: TIBTransaction; procedure btnSaveClick(Sender: TObject); procedure btnUndoClick(Sender: TObject); procedure FormCreate(Sender: TObject); private public end;
Stuck in this codes
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.btnSaveClick(Sender: TObject);const Tbl : array[1..1] of TIBDataSet = (Dt); begin Dba.ApplyUpdates(Tbl);end;
got an error
Error: typed constants of classes or interfaces are not allowed
EDIT
Change the code to this, seem fix the problem
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.btnSaveClick(Sender: TObject);var Tbl : array [1..1] of TDataSet; begin Tbl[1] := Dt; Dba.ApplyUpdates( Tbl);end;
korba812:
You can also do it like this:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.btnSaveClick(Sender: TObject);begin Dba.ApplyUpdates([Dt]);end;
incendio:
--- Quote from: korba812 on November 24, 2021, 11:48:42 am ---You can also do it like this:
--- Code: Pascal [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.btnSaveClick(Sender: TObject);begin Dba.ApplyUpdates([Dt]);end;
--- End quote ---
Nice, thanks for the info.
Navigation
[0] Message Index