Search the Community
Showing results for tags 'delphi 10.4'.
Found 4 results
-
TFDScript.ExecuteALL does not seem to behave as expected
Dustin T Waling posted a topic in Databases
Hello! I am struggling a little with the TFDScript object, and it does not seem to behave the way I would expect. I have tried multiple variations to the object properties in an attempt to make this work, but I expect I must be missing something. I simply want to execute a set of scripts that work together - the purpose of these are for our DB upgrades, so something like creating, or altering a Table requires a series of steps. So, this is what I chose the TFDScript object for. And, I can successfully run Script.ExecuteAll without error, however the SQL changes are not committed in the database. This does not matter if it is a DDL script or a data script, and I have tried using several different terminators, changing the timing of the commit (even including commit statements among the scripts), modified transaction handling, etc., etc.... So, I am still unable to simply run Script.ExecuteAll to get the intended result and have resorted to creating a function that loops through the scripts within a TFDScript object and executes each one individually. This seems a bit much as my understanding is that this is exactly what ExecuteAll should be doing. Below is the function I am using, and as you can see I am not doing any crazy fancy footwork to get the job done, it is very simple. I have even tried keeping the function and replacing only the for loop with ExecuteAll (also tried calling ValidateAll before ExecuteAll). - so, my question is why does this simple for loop work but ExecuteAll does not? function TdmBaseDBUpgrade.ExecuteFbScriptAll(aScript: TFDScript): boolean; var i: integer; begin aScript.Connection := Database; aScript.Connection.StartTransaction; try for i := 0 to (aScript.SQLScripts.Count -1) do begin if (UpperCase(aScript.SQLScripts[i].Name) <> 'ROOT') and (aScript.SQLScripts[i].SQL.Text <> '') then aScript.ExecuteScript(aScript.SQLScripts[i].SQL); end; finally if aScript.TotalErrors > 0 then begin Result := False; aScript.Connection.Rollback; end else begin Result := True; aScript.Connection.Commit; end; end; end; Ideally if we can get the more "automated" script handling working, then this would allow us to simplify a great deal of code in other places as well. -
delphi 10.4 Filter DBGrid by row (record) selected in another DBGrid
PjDS posted a topic in Databases
Dear Sirs, in my Delphi 10.4 Form1 there are: ADOConnection1, ADOQuery1, DataSource1, DBGrid1 (TDBGrid component) and ADOConnection2, ADOQuery2, DataSource2, DBGrid2 (TDBGrid component). I use ADOConnection1, ADOQuery1, DataSource1 for polupate DBGrid1 and the other ones for populate DBGrid2. ADOConnection1 and 2 use the same access database (DB1.accdb). I would like to filter the DBGrid2 records using the selection of one record over the DBGrid1. The filter must use a Field of the selectd record (row) in DBGrid1. Questions: Is it possible and Is the correct approach? It would be preferable to create the connection to the database and manage it via code (runtime) without using components on the form (ADOConnection, ADOQuery, etc)? Is it necessary to use two adoconnections if the database to which they are connected is the same? Thanks! -
Few months ago I prepared small demo application used FireDAC SQLite connection on an Android system. And it worked fine in an application built in Delphi 10.3. Then I updated Delphi to 10.4. And now I got: Project xxx.apk raised exception class ESQLiteNativeException with message ''. and after that: [FireDAC][Phys][SQLite] ERROR: no such table: items. Even table 'items' exists in the database file and I did not any changes in sources. Anyone had the same issue?
-
Hi, just for you guys to weigh in, we have located a bug in the Delphi 10.4 compiler, that removes a totally valid assign statement in RELEASE mode, believing, that the code will never be executed. The actual method is from the mORMot library in releases before last week (unit SynCommons.pas, method TSynAnsiFixedWidth.AnsiBufferToUTF8. A full discussion is available at the mORMot-Forum: https://synopse.info/forum/viewtopic.php?id=5520 . I have reported the bug to Embarcadero: https://quality.embarcadero.com/browse/RSP-30088 . Please check out my report and try to confirm and weigh in there. It should be reproducible. --- Note, the compiler will tell you (Hint H2077), that the value assigned is never used and thus, in RELEASE mode, with optimizations enabled, drop the code completely. Thanks for your time and support 👍
- 7 replies
-
- optimization
- bug
-
(and 1 more)
Tagged with: