-
Content Count
868 -
Joined
-
Last visited
-
Days Won
7
Everything posted by Stano
-
It depends on the purpose of use. If it is an embedded / local version, I recommend Firebird. There is no need to install anything. Just copy. Access is, as usual with MS, unlike other DBs. You will not acquire the right habits.
-
Such a small tool class function TFDFunction.TextInsertInto(const ATableName: string; AllFields: Boolean = False): string; var FTable: TFDTable; sFields, sValues: string; Field1: Integer; begin FTable := TFDFunction.NewTable(nil, ATableName); if AllFields then Field1 := 0 else Field1 := 1; try // Without primary key. It is auto increment. sFields := ATableName + ' ([' + FTable.FieldList[Field1].FullName + ']'; sValues := ' VALUES (:' + FTable.FieldList[Field1].FullName; for var I := Field1 + 1 to FTable.FieldList.Count - 1 do begin sFields := sFields + ', [' + FTable.FieldList[I].FullName+ ']'; sValues := sValues + ', :' + FTable.FieldList[I].FullName; end; Result := 'INSERT INTO ' +sFields + ')' + sValues + ')'; finally FreeAndNil(FTable); end; end;
-
My experiment (s) FMTSpace.UpdateOptions.UpdateTableName := 'DISTANCES'; FMTSpace.UpdateOptions.EnableInsert := True; FMTSpace.UpdateOptions.UpdateChangedFields := True; FMTSpace.Active := True; FMTSpace.CachedUpdates := True; /// Filling FMTSpace with data FMTSpace.ApplyUpdates(-1); That's how it works for me. I consider it extra work. for var J := 0 to FRecordCount -1 do begin for K := 0 to qryDistanceIns.Params.Count -1 do qryDistanceIns.Params[K].Values[J] := FMTSpace.Fields.Fields[K].Value; FMTSpace.Next; end; try TFDFunction.QryExecute(qryDistanceIns, True); finally FreeAndNil(qryDistanceIns); end; Unfortunately, the instructions and examples are more than brief. They are not complete. Thanks!
-
Defining field types in MemTable and retrieving data using CopyDataSet is the easiest for me. Only now did I realize that I had written nonsense in Uwe Rabe's answer. I meant MemTable.Data := MyQuery.Data. No CopyDataSet. I apologise.
-
More efficient string handling
Stano replied to parallax's topic in Algorithms, Data Structures and Class Design
You probably meant TFDBatchMoveTextReader -
I write here again that I am not a programmer. I seldom understand foreign code. The reason for asking the question: it's hard to find something, especially FireDAC, in help. Examples are: about something other than the topic very complicated incomplete, possibly with errors I couldn't find anything. I was successful later. I forgot to write it here. Thanks to all.
-
No, I have Delphi Professional.
-
Not for me. The SQL has "0 AS X". The actual field type in DB is Float. Therefore, I always define the MemTable structure for each use. As I was explained, Pointer is passed to CopyDataSet. Field type data is lost. X will be ftInteger. I don't have to deal with performance. These are just a few records / rows.
-
There was no other option than FDBatchMove. It already works for me. Thanks for the response.
-
Using translations in unit Consts with Delphi 10.4 VCL
Stano replied to Dirk Janssens's topic in VCL
I have the Slovensky.pas file quoted only in * .dpr. I'm not setting anything anywhere. I use TSM. I'm bypassing the OS dialogs. I can't say more about that. -
Using translations in unit Consts with Delphi 10.4 VCL
Stano replied to Dirk Janssens's topic in VCL
Yes. -
Using translations in unit Consts with Delphi 10.4 VCL
Stano replied to Dirk Janssens's topic in VCL
I once found it on the internet. It never disappointed me. unit slovensky; interface implementation uses System.Classes, Vcl.Forms, Vcl.Consts, Vcl.Dialogs; resourcestring SMsgDlgCZWarning = 'Výstraha'; SMsgDlgCZError = 'Chyba'; SMsgDlgCZInformation = 'Informácia'; SMsgDlgCZConfirm = 'Potvrdiť'; // Otázka SMsgDlgCZYes = 'Án&o'; SMsgDlgCZNo = '&Nie'; SMsgDlgCZOK = 'OK'; SMsgDlgCZCancel = 'Zruš'; SMsgDlgCZHelp = 'Nápoveď'; // SMsgDlgCZHelpNone = 'Nápoveď nie je'; // SMsgDlgCZHelpHelp = 'Nápoveď'; SMsgDlgCZAbort = '&Zrušiť'; SMsgDlgCZRetry = 'Opakovať'; SMsgDlgCZIgnore = '&Ignorovať'; SMsgDlgCZAll = '&Všetko'; SMsgDlgCZNoToAll = 'Nie všetkým'; SMsgDlgCZYesToAll = 'Ano všetkýmm'; SMsgDlgCZClose = 'Zavrieť'; const Captions: array[TMsgDlgType] of Pointer = (@SMsgDlgCZWarning, @SMsgDlgCZError, @SMsgDlgCZInformation, @SMsgDlgCZConfirm, nil); ButtonCaptions: array[TMsgDlgBtn] of Pointer = ( @SMsgDlgCZYes, @SMsgDlgCZNo, @SMsgDlgCZOK, @SMsgDlgCZCancel, @SMsgDlgCZAbort, @SMsgDlgCZRetry, @SMsgDlgCZIgnore, @SMsgDlgCZAll, @SMsgDlgCZNoToAll, @SMsgDlgCZYesToAll, @SMsgDlgCZHelp, @SMsgDlgCZClose); {$WARN SYMBOL_PLATFORM OFF} procedure _ChangeCaptions(List: TPointerList; Last: Pointer); const Two = 2; var I, Max: Integer; IsFind: Boolean; begin {$R-} try Max := (Integer(Last)-Integer(List)) div SizeOf(Pointer); IsFind := False; for I := 0 to Max - Two do if (List[I] = @SMsgDlgWarning) and (List[I + Two] = @SMsgDlgInformation) then begin IsFind := True; break; end; if IsFind then Move(Captions, List[I], SizeOf(Captions)); IsFind := False; for I := I to Max - Two do if (List[I] = @SMsgDlgYes) and (List[I + Two] = @SMsgDlgOK) then begin IsFind := True; break; end; if IsFind then Move(ButtonCaptions, List[I], SizeOf(ButtonCaptions)); finally {$R+} end; end; initialization // _ChangeCaptions(@DebugHook, @Application); end. -
Parnassus Bookmarks for Delphi 11 Alexandria?
Stano replied to PeterPanettone's topic in Delphi IDE and APIs
Unlike me. -
Parnassus Bookmarks for Delphi 11 Alexandria?
Stano replied to PeterPanettone's topic in Delphi IDE and APIs
11.1. it's november 1? In this case, it does not look like this for the foreseeable future Thanks! -
I hope they fix it.
-
This forum works weird. I had exactly the same problem. I wrote in support. They fixed the problem. I reported a problem with cleaning uses. They don't respond. I wasn't alone. Here you have an email at Liu Xiao liuxiao@cnpack.org
-
The Curiously Recurring Generic Pattern
Stano replied to Erik@Grijjy's topic in Tips / Blogs / Tutorials / Videos
It happens to me too. In that case, I run the build. I have small projects. Suddenly everything is fine. Up to two I don't know if this is your case either. -
For me, a layman, yes. The argument was made: why do you want to solve something that other DBs have solved? That decided.
-
I do not know and do not use SQLite. I know one thing. All values are always stored in the DB as string / VarChar. Remember that and look for a mistake here. Defining the field type is only to make your work easier. As far as I know, this will not ensure that you write incorrect data to table. When I found SQLite and found how complicated it was to work with dates, I quickly rejected it.
-
So use that AbsoluteIndex.
-
You can also use the internal order numbering. Although not highly recommended. AbsoluteIndex.
-
I personally always use amInsertBefore. The user quickly finds out and arranges accordingly. Of course, the problem is when the row has to go to the end. Then he must move two rows. Sender.MoveTo(Sender.FocusedNode, Sender.DropTargetNode, amInsertBefore, False);
-
begin ... const MaxInfo = 3; var FInfo: AnsiString; for var I := 0 to MaxInfo do It bothers a little.
-
I use two ways: Text - I will copy it to another application. Text editor, Excel, Word ... The reason for Word is the fact that I have a line length of 120 characters. This will fit in one line in Word. When I copy a block, I lose the line numbering. That usually doesn't matter Screenshot - I will edit the given image (negative). I'm not used to printing from the IDE. It kind of doesn't suit me.