sqlitelaz.lpk linking error lazarus / 16-Databases ---------------------------------------------------------------------- Aruna · 2024-07-11 01:54 Hello, I am trying to compile then install sqlitelaz.lpk. Compiling is a success. When trying to link I get the errors below: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Build IDE: Exit code 2, Errors: 3, Warnings: 1Warning: svn not in path.Error: /usr/bin/ld.bfd: cannot find -lsqlitemake[2]: *** [Makefile:4667: lazarus] Error 1make[1]: *** [Makefile:5105: idepkg] Error 2Error: make: *** [Makefile:3793: idepkg] Error 2lazarus.pp(167,1) Error: Error while linking Any guidance or workarounds would be most welcome. Thank you. Aruna ---------------------------------------------------------------------- TRon · 2024-07-11 02:13 Do you run a Debian based distro ? If answered yes then try installing the libsqlite dev package. PS: Also make sure the FPC configuration contains the library path that matches your system. ---------------------------------------------------------------------- Aruna · 2024-07-11 02:45 Quote from: TRon on July 11, 2024, 04:13:52 amDo you run a Debian based distro ?Yes I do Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i aruna@debian:~$ uname -aLinux debian 6.4.8-usb #8 SMP PREEMPT_DYNAMIC Fri Feb  9 17:21:43 EST 2024 x86_64 GNU/Linux Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i aruna@debian:~$ lsb_release -aNo LSB modules are available.Distributor ID: DebianDescription:    Debian GNU/Linux 11 (bullseye)Release:      11Codename:       bullseye If answered yes then try installing the libsqlite dev package. I already did :-) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i aruna@debian:~$ dpkg -s libsqlite3-devPackage: libsqlite3-devStatus: install ok installed Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i aruna@debian:~$ apt list --installed | grep libsqlite3libsqlite3-0/oldstable,now 3.34.1-3 amd64 [installed,automatic]libsqlite3-dev/oldstable,now 3.34.1-3 amd64 [installed]  PS: Also make sure the FPC configuration contains the library path that matches your system. This is where I can use some help, please. How does one access and edit the FPC configuration file? ---------------------------------------------------------------------- TRon · 2024-07-11 02:57 I applaud the contents of your reply but not the quoting  so I'll refrain from quoting on those answers I considered to be correct :-) Quote from: Aruna on July 11, 2024, 04:45:55 amThis is where I can use some help, please. How does one access and edit the FPC configuration file? Do you know how to invoke the fpc command line compiler from the terminal ? (PS: make sure it is the same fpc command line compiler that your Lazarus is configured to use) If so then run that command with the option -va (you do not have to provide a file to compile). It will output a lot of output from the compiler including which fpc.cfg file is used (the location and name). If you have the location and name of the fpc.cfg file then edit that file and look for an entry that reads something like: Code: [Select]-Fl/usr/lib/gcc/x86_64-linux-gnu/12 That is what my own setup uses for library path but yours might differ. Make sure that path actually exist and in case not then modify it accordingly to your setup. ---------------------------------------------------------------------- Aruna · 2024-07-11 14:11 Quote from: TRon on July 11, 2024, 04:57:01 amI applaud the contents of your reply but not the quoting  so I'll refrain from quoting on those answers I considered to be correct :-)It has been a while since I last visited the forum and apologies about the quoting :-) and yes all your answers so far have been correct I just wanted to give you as much information as I can to help resolve this  QuoteQuote from: Aruna on July 11, 2024, 04:45:55 amThis is where I can use some help, please. How does one access and edit the FPC configuration file? Do you know how to invoke the fpc command line compiler from the terminal ? (PS: make sure it is the same fpc command line compiler that your Lazarus is configured to use) If so then run that command with the option -va (you do not have to provide a file to compile). It will output a lot of output from the compiler including which fpc.cfg file is used (the location and name).No I have never used the command line compiler. Guess now is the time to start  QuoteIf you have the location and name of the fpc.cfg file then edit that file and look for an entry that reads something like: QuoteCode: [Select]-Fl/usr/lib/gcc/x86_64-linux-gnu/12 I used Projects-->Project Options and plugged in the path there under compiler options. I have attached a screenshot. Still getting the error :-( QuoteThat is what my own setup uses for library path but yours might differ. Make sure that path actually exist and in case not then modify it accordingly to your setup. Many thanks for all the guidance. I will try again and get back to you. ---------------------------------------------------------------------- TRon · 2024-07-12 03:01 Quote from: Aruna on July 11, 2024, 04:11:37 pmIt has been a while since I last visited the forum and apologies about the quoting :-) and yes all your answers so far have been correct I just wanted to give you as much information as I can to help resolve this  That is why I applauded the information you posted. All is good Quote from: Aruna on July 11, 2024, 04:45:55 amnever used the command line compiler. Guess now is the time to start  A little tradesecret: If you use Lazarus to build and compile projects then you use the commandline compiler (though indirectly and under the hood, but still  ). QuoteI used Projects-->Project Options and plugged in the path there under compiler options. I have attached a screenshot. Still getting the error :-( That is an interesting approach and one I did not used myself. Are you sure you do not need a version directory appended to that path as per my setup example (12, most likely 11 for your specific version of debian) ? (not all debian based distros install it in a similar manner so it might indeed be different for you but it has been a long time I saw libs installed in a path without a version number explicitly mentioned) BTW from what I am able to tell you seem to explicitly use unit sqlite ? If that is the case and you have no apparent reason for doing so then use unit sqlite3 instead. If all else fails, try to add the option -k--verbose to the compiler options as it shows all the paths that the linker is using to attempt to locate the library. If you look a the the output log with Lazarus then make sure to copy /all/ the messages out of the message window (and paste them in to a text editor or similar) as many messages are filtered by default. ---------------------------------------------------------------------- TRon · 2024-07-12 03:16 Quote from: TRon on July 12, 2024, 05:01:10 amBTW from what I am able to tell you seem to explicitly use unit sqlite ? If that is the case and you have no apparent reason for doing so then use unit sqlite3 instead. Ok, I now tried to install the same Lazarus package and ran into the exact same issue. Me thinks an oversight. This requires further investigation e.g. meaning not your fault or related to your setup. edit: try to install package sqlite3laz instead. Which version (please be exact) of the Lazarus IDE do you use ? ---------------------------------------------------------------------- Thaddy · 2024-07-12 04:11 It has nothing to do with lazarus itself, it is the package that is broken or easily broken for many years. For sqlite, plz use sqldb and the sqlite3 connector, that is way more stable and totally different code. I know how to fix the problem: it is a design time load and versioning problem. The best way out is to use static linking, but that is uncomfortable for most. The other way out is to try and merge the sqlite3 code for sqldb into the old sqlitedb code. Again: sqlitedb is broken for years and most would even say deprecated. You really have to know what you are doing to get it working. It is not very comfortable to use, because of various design issues. But if you want to use sqlite 2 it is still the only option, since there is no sqldb connector for sqlite 2. (sqlite 2 is much lighter at less than 100k) BTW if you use it from code, so no design time component, the issue magically disappears..in most cases. Be aware of that. This old package is written with too many assumptions by the author. It is those assumptions that breaks it for many. ---------------------------------------------------------------------- TRon · 2024-07-12 04:27 Ah you revised your answer Thaddy as I was going to mention that the 'old' package still exist only for using the sqlite before v3. At this pojnt I am inclined to agree with the deprecated remark as Debian itself does not seem to support libsqlite < 3 out of the box. I simply overlooked so this issue took longer than necessary for which my apologies. ---------------------------------------------------------------------- Thaddy · 2024-07-12 04:29 Yes, I had to add to my answer, because I was testing and remembered all kinds of horror stories.... sorry that I was editting and caused a posts crossed.. ---------------------------------------------------------------------- Thaddy · 2024-07-12 04:34 You can still get sqlite 2 from sqlite.org. Compile from source. ---------------------------------------------------------------------- TRon · 2024-07-12 04:44 Quote from: Thaddy on July 12, 2024, 06:29:39 am...sorry that I was editting and caused a posts crossed.. These things tend to happen from time to time so no problem  . Thank you for your input. ---------------------------------------------------------------------- Aruna · 2024-07-12 18:00 Quote from: TRon on July 12, 2024, 05:01:10 amA little tradesecret: If you use Lazarus to build and compile projects then you use the commandline compiler (though indirectly and under the hood, but still  ). I tried compiling at the command line, please see below:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i aruna@debian:~/lazarus/csv$ fpc -MObjFPC unit1.pasFree Pascal Compiler version 3.2.0+dfsg-12 [2021/01/25] for x86_64Copyright (c) 1993-2020 by Florian Klaempfl and othersTarget OS: Linux for x86-64Compiling unit1.pasunit1.pas(8,38) Fatal: Can't find unit Forms used by Unit1Fatal: Compilation abortedError: /usr/bin/ppcx64 returned an error exitcode I am assuming it is complaining about Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  Classes, SysUtils, db, csvdataset, Forms, Controls, Graphics, Dialogs,  DBGrids, ExtDlgs, StdCtrls, FileUtil ;  As that is what I use in my project. For now I think I will use the IDE as it works smoothly and I do not have to tinker with the internals. At some point in time I will start using fpc at the commandline QuoteI used Projects-->Project Options and plugged in the path there under compiler options. I have attached a screenshot. Still getting the error :-( QuoteThat is an interesting approach and one I did not used myself. I asked Google and that is what it showed me as a possible solution, so I went with it. QuoteAre you sure you do not need a version directory appended to that path as per my setup example (12, most likely 11 for your specific version of debian) ? (not all debian based distros install it in a similar manner so it might indeed be different for you but it has been a long time I saw libs installed in a path without a version number explicitly mentioned) Well, this is what my system has: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i aruna@debian:~/lazarus/csv$ sudo find /usr/lib/ -type f -name "libsqlite*"[sudo] password for aruna: /usr/lib/x86_64-linux- gnu/libsqlite3.so.0.8.6/usr/lib/x86_64-linux- gnu/libsqlite3.a and..Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i aruna@debian:~/lazarus/csv$ ls -1alh /usr/lib/x86_64-linux- gnu/*sql*-rw-r--r-- 1 root  root  1.7M Feb 24  2021 /usr/lib/x86_64-linux-gnu/libsqlite3.alrwxrwxrwx 1 root  root    19 Feb 24  2021 /usr/lib/x86_64-linux-gnu/libsqlite3.so -> libsqlite3.so.0.8.6lrwxrwxrwx 1 aruna aruna   19 Feb 24  2021 /usr/lib/x86_64-linux-gnu/libsqlite3.so.0 -> libsqlite3.so.0.8.6-rw-r --r-- 1 aruna aruna 1.3M Feb 24  2021 /usr/lib/x86_64-linux- gnu/libsqlite3.so.0.8.6 QuoteBTW from what I am able to tell you seem to explicitly use unit sqlite ? If that is the case and you have no apparent reason for doing so then use unit sqlite3 instead. Let me give you some context so you know exactly what happened. I opened the Lazarus IDE and I did not see a SQLdb tab in the component palette. Then I searched on how to enable that. And I just tried the unit SQLite to see if it would work and give me the SQLdb tab. No luck. This is when I decided to ask on the forum. If anyone knows a way to enable this SQLdb tab on the component palette please do share? QuoteIf all else fails, try to add the option -k--verbose to the compiler options as it shows all the paths that the linker is using to attempt to locate the library. If you look a the the output log with Lazarus then make sure to copy /all/ the messages out of the message window (and paste them in to a text editor or similar) as many messages are filtered by default. I will definitely give it a try. Thank you. ---------------------------------------------------------------------- Aruna · 2024-07-12 18:50 Quote from: TRon on July 12, 2024, 05:16:44 amOk, I now tried to install the same Lazarus package and ran into the exact same issue. Me thinks an oversight. Really? This is starting to get interesting  QuoteThis requires further investigation e.g. meaning not your fault or related to your setup. Don't be so sure it is not my fault. Quite possibly I may have done something I should not have in the name of learning, gaining more knowledge and wisdom. Or simply mucking around tweaking stuff to see oh-kay let's see what changing this will do? Like when long years ago I closed all the IDE's windows. I must have spent a good week trying to put things back the way they were. Luckily I found an article https://wiki.freepascal.org/ Anchor_Docking#Usage_I._.28Add_docking_support_to_the_Lazarus_IDE.29 that showed how to drag and dock the windows again. Phew,that was fun.! By the way, I have multiple linux kernels and multiple versions of Lazarus on this box  Quoteedit: try to install package sqlite3laz instead I tried and I am getting a weird error. I have attached a screenshot. QuoteWhich version (please be exact) of the Lazarus IDE do you use ? Version 2.2.5. Screenshot attached ---------------------------------------------------------------------- TRon · 2024-07-13 08:43 Quote from: Aruna on July 12, 2024, 08:00:43 pmI tried compiling at the command line, please see below: Note that I was only suggesting to use the fpc commandline compiler to get information about which fpc.cfg file is in use by it. Actually compiling a whole Lazarus project requires a bit more incentive and is much easier to accomplish using lazbuild (which indirectly uses FPC again). QuoteI am assuming it is complaining about Indeed the error about the missing Form's unit is because PFC itself is not configured to use Lazarus components (that is what Lazarus does for us/FPC, or better said the lazarus project file information, of which FPC itself has no notion whatsoever). If you know what you're doing then it is possible to compile Lazarus projects with the FPC commandline compiler but it is tedious because it requires quite a lot of knowledge and manual configuration regarding Lazarus components. As said, it is much easier (and exactly intended for that puspose) to use lazbuild to build Lazarus projects from the commandline. ---------------------------------------------------------------------- TRon · 2024-07-13 08:49 Quote from: Aruna on July 12, 2024, 08:50:57 pmDon't be so sure it is not my fault. Quite possibly I may have done something I should not have in the name of learning, gaining more knowledge and wisdom. Well right now with the mention of your latest issue I am indeed very unsure what it is you ran into. fwiw: To make sure, I've installed sqlite3laz package in/with Lazarus 2.2.4 without any issues. QuoteI have multiple linux kernels and multiple versions of Lazarus on this box  Just make sure to separate the configuration (directory) between different Lazarus versions QuoteQuoteedit: try to install package sqlite3laz instead I tried and I am getting a weird error. I have attached a screenshot. I am not familiar with the issue as presented. QuoteQuoteWhich version (please be exact) of the Lazarus IDE do you use ? Version 2.2.5. Screenshot attached Thank you. That allowed me to use/test 2.2.4 and install sqlite3laz and see if that worked which it did. Therefor atm I can only assume that you ran into another (unrelated) issue. ---------------------------------------------------------------------- Aruna · 2024-07-13 16:52 Quote from: TRon on July 13, 2024, 10:49:16 amI am not familiar with the issue as presented. I was spending too much time trying to get the SQLDB tab enabled. So I decided to shelf this for a later time and look for alternative options. I dropped a DataSource, CSVDataset and a TDBGrid on a form and it took me a while to figure out things but now I have a working tool. I have attached the source for anyone interested. When I type into the Edit box and click the button the grid updates and displays the dataset correctly. If you click the column headers it will sort the entire dataset. Sorting is limited to ascending, is there a way to sort in other ways? I also want to implement a functionality when I type the dataset should update and display any records that match what I have typed so far. What would be the best way to do this? Thank you all for your advice and help. The source is below: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unit Unit1; {$mode objfpc}{$H+} interface uses  Classes, SysUtils, db, csvdataset, Forms, Controls, Graphics, Dialogs,  DBGrids, ExtDlgs, StdCtrls, FileUtil ; type   { TForm1 }   TForm1 = class(TForm)    Button1: TButton;     CSVDataset1: TCSVDataset;    DataSource1: TDataSource;    DBGrid1: TDBGrid;    OpenPictureDialog1: TOpenPictureDialog;    SearchEdit: TEdit;    SearchButton: TButton;   procedure DBGrid1TitleClick(Column: TColumn);    procedure FormCreate(Sender: TObject);    procedure SearchButtonClick(Sender: TObject);   private   public   end; var  Form1: TForm1;  implementation {$R *.lfm} { TForm1 } procedure TForm1.DBGrid1TitleClick(Column: TColumn);begin  CSVDataset1.IndexFieldNames := Uppercase(Column.Title.Caption);end; procedure TForm1.FormCreate(Sender: TObject);begin  CSVDataset1.LoadFromCSVFile('/home/aruna/qemu/worldcities.csv');  CSVDataset1.Open;end; procedure TForm1.SearchButtonClick(Sender: TObject);var  country: string;begin  country := SearchEdit.Text;  CSVDataSet1.Filtered := False; // Disable previous filters  CSVDataSet1.Filter := Format('country = ''%s''', [country]);// CSVDataSet1.Filter := Format('country = '' LIKE ''%s''', [country]);  CSVDataSet1.Filtered := True;  end;  end. The csv data is too large to attach so I have truncated and given below:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i city,city_a scii,lat,lng,country,iso2,iso3,admin_name,capital,population,idTokyo,T okyo,35.6897,139.6922,Japan,JP,JPN,Tōkyō,primary,37732000,1392685764Ja karta,Jakarta,- 6.1750,106.8275,Indonesia,ID,IDN,Jakarta,primary,33756000,1360771077De lhi,Delhi,28.6100,77.2300,India,IN,IND,Delhi,admin,32226000,1356872604 Guangzhou,Guangzhou,23.1300,113.2600,China,CN,CHN,Guangdong,admin,2694 0000,1156237133Mumbai,Mumbai,19.0761,72.8775,India,IN,IND,Mahārāshtra, admin,24973000,1356226629Manila,Manila,14.5958,120.9772,Philippines,PH ,PHL,Manila,primary,24922000,1608618140Shanghai,Shanghai,31.1667,121.4 667,China,CN,CHN,Shanghai,admin,24073000,1156073548São Paulo,Sao Paulo,-23.5500,-46.6333,Brazil,BR,BRA,São Paulo,admin,23086000,1076532519Seoul,Seoul,37.5600,126.9900,South Korea,KR,KOR,Seoul,primary,23016000,1410836482Mexico City,Mexico City,19.4333,-99.1333,Mexico,MX,MEX,Ciudad de México,primary,21804000, 1484247881Cairo,Cairo,30.0444,31.2358,Egypt,EG,EGY,Al Qāhirah,primary,20296000,1818253931New York,New York,40.6943,-73.9249,United States,US,USA,New York,,18972871,18400340 16Dhaka,Dhaka,23.7639,90.3889,Bangladesh,BD,BGD,Dhaka,primary,18627000 ,1050529279Beijing,Beijing,39.9040,116.4075,China,CN,CHN,Beijing,prima ry,18522000,1156228865Kolkāta,Kolkata,22.5675,88.3700,India,IN,IND,Wes t Bengal,admin,18502000,1356060520Bangkok,Bangkok,13.7525,100.4942,Tha iland,TH,THA,Krung Thep Maha Nakhon,primary,18007000,1764068610Shenzhe n,Shenzhen,22.5350,114.0540,China,CN,CHN,Guangdong,minor,17619000,1156 158707Moscow,Moscow,55.7558,37.6178,Russia,RU,RUS,Moskva,primary,17332 000,1643318494Buenos Aires,Buenos Aires,-34.5997,-58.3819,Argentina,AR,ARG,Buenos Aires, Ciudad Autónoma de,primary,16710000,1032717330Lagos,Lagos,6.4550,3.3841,Nigeria,NG,NGA ,Lagos,minor,16637000,1566593751Istanbul,Istanbul,41.0136,28.9550,Turk ey,TR,TUR,İstanbul,admin,16079000,1792756324Karachi,Karachi,24.8600,67 .0100,Pakistan,PK,PAK,Sindh,admin,15738000,1586129469Bangalore,Bangalo re,12.9789,77.5917,India,IN,IND,Karnātaka,admin,15386000,1356410365Ho Chi Minh City,Ho Chi Minh City,10.7756,106.7019,Vietnam,VN,VNM,Hồ Chí Minh,admin,15136000,1704774326Ōsaka,Osaka,34.6939,135.5022,Japan,JP,JP N,Ōsaka,admin,15126000,1392419823Chengdu,Chengdu,30.6600,104.0633,Chin a,CN,CHN,Sichuan,admin,14645000,1156421555Tehran,Tehran,35.6892,51.388 9,Iran,IR,IRN,Tehrān,primary,14148000,1364305026Kinshasa,Kinshasa,- 4.3250,15.3222,Congo (Kinshasa),CD,COD,Kinshasa,primary,12836000,1180000363Rio de Janeiro,Rio de Janeiro,-22.9111,-43.2056,Brazil,BR,BRA,Rio de Janeiro, admin,12592000,1076887657Chennai,Chennai,13.0825,80.2750,India,IN,IND, Tamil Nādu,admin,12395000,1356374944 ---------------------------------------------------------------------- TRon · 2024-07-14 07:06 Quote from: Aruna on July 13, 2024, 06:52:45 pmI was spending too much time trying to get the SQLDB tab enabled. I understand you moved on but just a few remarks. The last error you showed is a unit that should only be compiled when compiling for mac and it really beats me how you got there. afaik sqlite3laz 0.4 (note, not sqlitelaz 0.4) only adds the sqlite dataset to the data access tab. In order to get the SQLDB tab you are required to install SQLDBLaz 1.0.2 (see also wiki) Both can be installed from the install/uninstall packages menu-item in the IDE (move from right to left listbox) and then press the save and rebuild IDE button. If you installed the bigide then the SQLDB package is already installed by default. QuoteSo I decided to shelf this for a later time and look for alternative options. That is some nice progress. QuoteSorting is limited to ascending, is there a way to sort in other ways? For a CVSDataSet, not that I am aware of. QuoteI also want to implement a functionality when I type the dataset should update and display any records that match what I have typed so far. What would be the best way to do this? You already implemented that by using the filter ? Or are you specifically asking about how to (re)act on keypresses in TEdit ? (see also TEdit doc) In case you are asking about TEdit then have a look at the documentation I linked to regarding the events onkeydown, onkeypress and onkeyup. Everytime a key is accepted you could invoke setting/updating your filter. Do realize though that if your dataset is huge that there can be a delay. You can try approach that with using a thread (for filtering) or a timer (for pressing keys) or perhaps someone else has a better idea ? ---------------------------------------------------------------------- Aruna · 2024-07-15 01:00 Quote from: TRon on July 14, 2024, 09:06:58 amThe last error you showed is a unit that should only be compiled when compiling for mac and it really beats me how you got there. If you look again at the screenshot I posted regarding this error you will see a file path ending with appkit.pas I think I was trying to create a new graphical app but I also have no clue what I did to include this in the project. It was an error caused by my experimenting  nothing to do with Lazarus  Quoteafaik sqlite3laz 0.4 (note, not sqlitelaz 0.4) only adds the sqlite dataset to the data access tab. In order to get the SQLDB tab you are required to install SQLDBLaz 1.0.2 (see also wiki) Both can be installed from the install/uninstall packages menu-item in the IDE (move from right to left listbox) and then press the save and rebuild IDE button. If you installed the bigide then the SQLDB package is already installed by default. This is what I wanted to know. Thank you very much. You have effectively cleared up the question I had. I had read about bigide but so far have not compiled and used it. QuoteQuoteSo I decided to shelf this for a later time and look for alternative options. That is some nice progress. Thank you. Yes it is nice when your code does what you want it to.. QuoteQuoteSorting is limited to ascending, is there a way to sort in other ways? For a CVSDataSet, not that I am aware of. If I wanted to try and build that functionality into a CVSDataset where do I find the source code? And are there any tutorials, guides, or documentation about how to go about doing this? QuoteQuoteI also want to implement a functionality when I type the dataset should update and display any records that match what I have typed so far. What would be the best way to do this? You already implemented that by using the filter ? Yes I implemented a filter and it works but not each key press real time dataset refresh and update (yet) QuoteOr are you specifically asking about how to (re)act on keypresses in TEdit ? (see also TEdit doc) In case you are asking about TEdit then have a look at the documentation I linked to regarding the events onkeydown, onkeypress and onkeyup. Everytime a key is accepted you could invoke setting/updating your filter. I finally got it working but I do not much like the way I am doing things. It was the only way I could think of and it does work so... we have realtime every keypress CSVdataset updates. The source is below.Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.EditFilterChange(Sender: TObject);var  country: string;begin  country := EditFilter.Text;  country := country+'*';  //THE TRICK WAS TO ADD A WILDCARD "*" TO THE FILTER STRING AT THE END OF EACH KEYPRESS. THERE HAS TO BE A BETTER WAY?  CSVDataSet1.Filtered := False; // Disable previous filters  CSVDataSet1.Filter := Format('country = ''%s''', [country]);  CSVDataSet1.Filtered := True;  end;                       QuoteDo realize though that if your dataset is huge that there can be a delay. You can try approach that with using a thread (for filtering) or a timer (for pressing keys) or perhaps someone else has a better idea ? You know the funny thing is my dataset is not big data as such but it is a large set of data comprising of 44,692 records. So far the response has been very fast. Almost instant I feel. I threw everything at it trying to break things or get it to slow down on screen updates and refresh and so far Lazarus has handled it extremely well. Once again many thanks for the bigide tip and all the other insights. ---------------------------------------------------------------------- TRon · 2024-07-15 05:55 Quote from: Aruna on July 15, 2024, 03:00:25 amIf I wanted to try and build that functionality into a CVSDataset where do I find the source code? And are there any tutorials, guides, or documentation about how to go about doing this? The normal route to determine where the source-code resides is to open the help and search for the components name. Unfortunately your version of Lazarus' accompanied helpfiles do not seem to include the specific help-page (by default). Alternatively it is possible to make a simple search of the component's name in a search-engine (TCSVDataSet and FreePascal) that lands us here and which tells us that the component is part of package fcl-db (top right corner) and resides in unit csvdataset (top left corner). Normally the Lazarus installation comes accompanied with the source- code for the different FPC packages (because the IDE relies on them) so you can access the source-code that way. Alternatively you can find the source-code of the package fcl-db here and for csvdataset in particular here. Do note that the revision of that online source-code is trunk/main and which does not have to match 100% with the code accompanied with your version of lazarus (2.2.5). However realize that csv is a pretty restricted format and that normally the underlying db engine is responsible for the ordering of data unless you have the data in the db stored in different orders (keys). I do not even know if CSVDataset is able to select different keys. SQL for example allows for change of the sortorder of a fieldvalue using a select statement. I am not aware of any documentation regarding adjusting existing code of a csvdataset (or datasets in general) to customize it. You really would have to look the source-code and assess if it is even possible to accomplish what you have set out to make it do. QuoteI finally got it working but I do not much like the way I am doing things. Ah, ic you used the onchange event. That is even better :-) What is it exactly that you do not like about that code ?  The filter itself using a mask ? Because there really isn't a better way to match contents of a field when using a filter. QuoteYou know the funny thing is my dataset is not big data as such but it is a large set of data comprising of 44,692 records. So far the response has been very fast. Almost instant I feel If you are happy with the reaction time then you do not have to improve any further. I was referring to millions of records and even then things depend on the speed of your hardware ---------------------------------------------------------------------- Aruna · 2024-07-16 02:30 Quote from: TRon on July 15, 2024, 07:55:50 amHowever realize that csv is a pretty restricted format and that normally the underlying db engine is responsible for the ordering of data unless you have the data in the db stored in different orders (keys). I do not even know if CSVDataset is able to select different keys. Lazarus does allow a CSVDataset to be treated like a database. And yes it can be indexed using code shown below:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i // Index by field names (Name, Position, Salary)  CsvDataset.IndexFieldNames('Name,Position,Salary');QuoteI am not aware of any documentation regarding adjusting existing code of a csvdataset (or datasets in general) to customize it. You really would have to look the source-code and assess if it is even possible to accomplish what you have set out to make it do. I just found you can do something like this using DESC short for descending which you obviously knew  : Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i LoadFromCSVFile('worldcities.csv');IndexFieldNames := 'country DESC;population DESC;QuoteQuoteI finally got it working but I do not much like the way I am doing things. Ah, ic you used the onchange event. That is even better :-)Yes it works well. QuoteWhat is it exactly that you do not like about that code ?  The filter itself using a mask ? Because there really isn't a better way to match contents of a field when using a filter. Yes the mask I felt was a lame attempt by me after trying many other attempts. But if you say that is the way to do it I will stop feeling there must be another better way  QuoteQuoteYou know the funny thing is my dataset is not big data as such but it is a large set of data comprising of 44,692 records. So far the response has been very fast. Almost instant I feel If you are happy with the reaction time then you do not have to improve any further. I was referring to millions of records and even then things depend on the speed of your hardware  I plugged in a CSV dataset that has over a million records. 5 million. And you were right the delay is very noticeable and annoying. Anything upto fifty thousand records Lazarus handles beautifully. As the data gets larger the update/refresh becomes slower. In my case it took almost 20 something seconds.It does work but who wants to wait 20 seconds in between each keypress ---------------------------------------------------------------------- Aruna · 2024-07-19 17:52 Quote from: TRon on July 14, 2024, 09:06:58 amThe last error you showed is a unit that should only be compiled when compiling for mac and it really beats me how you got there.Hi, I just found out how I managed to get the unit for mac in my project. I was trying to install customdrawn0.0 and when I asked Lazarus to install then re-build the IDE "that" is when somehow the mac unit get's pulled in. Just thought I will let you know. ---------------------------------------------------------------------- TRon · 2024-07-20 08:04 @aruna: Thank you for letting us know. That must be one of the most weird things I have seen mentioned in ages. If you are able to reproduce and have the time then by all means make a specific mention of it (error, log, steps to reproduce). There are issues with recompiling the IDE when system installed (access rights) so your issue might be a specific symptom but not that that I can recall to have seen before. ---------------------------------------------------------------------- Aruna · 2024-07-20 12:43 Quote from: TRon on July 20, 2024, 10:04:35 am@aruna: Thank you for letting us know. That must be one of the most weird things I have seen mentioned in ages. If you are able to reproduce and have the time then by all means make a specific mention of it (error, log, steps to reproduce). I will do so.. Quote from: TRon on July 20, 2024, 10:04:35 amThere are issues with recompiling the IDE when system installed (access rights) so your issue might be a specific symptom but not that that I can recall to have seen before. I uploaded a screen recoding of mydesktop here which clearly shows the weird behaviour. ---------------------------------------------------------------------- TRon · 2024-07-20 14:58 Quote from: Aruna on July 20, 2024, 02:43:06 pmI uploaded a screen recoding of mydesktop here which clearly shows the weird behaviour. Thank you and IC. Strange as it works for me tm (just tested with Lazarus 3.4) Did you by any chance made any changes to tools, configure "Build Lazarus" ? ---------------------------------------------------------------------- Aruna · 2024-07-20 21:36 Quote from: TRon on July 20, 2024, 04:58:53 pmStrange as it works for me tm (just tested with Lazarus 3.4) I am actually thinking of installing the latest Lazarus. I think I have two versions of Lazarus installed on my system. Should I backup them first then remove/delete everything or just download the precompiled binary then extract and run the intsaller? Quote from: TRon on July 20, 2024, 04:58:53 pmDid you by any chance made any changes to tools, configure "Build Lazarus" ? I am attaching a screenshot. As far as I can remember, I do not think I made any changes. ---------------------------------------------------------------------- TRon · 2024-07-21 09:19 Quote from: Aruna on July 20, 2024, 11:36:26 pmI am actually thinking of installing the latest Lazarus. Should be working with previous versions of Lazarus as well, though no experience with installing that package in particular. QuoteI think I have two versions of Lazarus installed on my system. Should I backup them first then remove/delete everything or just download the precompiled binary then extract and run the intsaller? Depends on how those Lazarus' were installed I would advise against running the installer, at least not using the default location for installation in case you have (or want to have) multiple versions on your system. The part where you have to pay attention with multiple installations of Lazarus is the Lazarus configuration directory (see also https://wiki.freepascal.org/Multiple_Lazarus) and ofc you can't have all Lazarus versions installed in the exact same directory (f.e. I have them separated by version number, e.g. /apps/lazarus/2.2.4/..., /apps/lazarus/3.4/... etc). As long as you keep the configuration directories separated then there is no need to backup (your config directory) (but make sure you do just in case). There is also a process recently described by I believe user dbannon on the forum that describes how to upgrade your Lazarus from a previous version without the need to install everything again manually (I would have to look that up in case I am able to find it and in case you have an interest in that) (*) I personally build my Lazarus' from source (see also https://wiki.laza rus.freepascal.org/Getting_Lazarus#Compiling_and_running_Lazarus) and have them installed in user space (e.g. make users part of a custom dev group with corresponding access rights so that rebuilding the IDE does not run into issues = known Achilles' heel atm for some platforms). Quote I am attaching a screenshot. As far as I can remember, I do not think I made any changes. Thank you. Indeed that looks all pretty normal. edit: (*) see https://forum.lazarus.freepascal.org/index.php/topic,678 59.msg523279.html#msg523279 ---------------------------------------------------------------------- Aruna · 2024-07-21 22:01 Quote from: TRon on July 21, 2024, 11:19:20 amQuote from: Aruna on July 20, 2024, 11:36:26 pmI am actually thinking of installing the latest Lazarus. Should be working with previous versions of Lazarus as well, though no experience with installing that package in particular. I have been experimenting so much since I first installed the Lazarus IDE and may have introduced unintended errors along the way due to being a newbie. The reason I was thinking to re-install everything from scratch is to try and get back to a clean error free install. QuoteQuoteI think I have two versions of Lazarus installed on my system. Should I backup them first then remove/delete everything or just download the precompiled binary then extract and run the intsaller? Depends on how those Lazarus' were installed Yes, very true. QuoteI would advise against running the installer, at least not using the default location for installation in case you have (or want to have) multiple versions on your system.Alright understood and will be careful. QuoteThe part where you have to pay attention with multiple installations of Lazarus is the Lazarus configuration directory (see also https://wiki.freepascal.org/Multiple_Lazarus) and ofc you can't have all Lazarus versions installed in the exact same directory (f.e. I have them separated by version number, e.g. /apps/lazarus/2.2.4/..., /apps/lazarus/3.4/... etc). Thank you, I will go through the wiki article. QuoteAs long as you keep the configuration directories separated then there is no need to backup (your config directory) (but make sure you do just in case). There is also a process recently described by I believe user dbannon on the forum that describes how to upgrade your Lazarus from a previous version without the need to install everything again manually (I would have to look that up in case I am able to find it and in case you have an interest in that) (*) Yes I would be very interested in how dbannon upgraded his Lazarus without installing everything manually. QuoteI personally build my Lazarus' from source (see also https://wiki .lazarus.freepascal.org/Getting_Lazarus#Compiling_and_running_Lazarus) and have them installed in user space (e.g. make users part of a custom dev group with corresponding access rights so that rebuilding the IDE does not run into issues = known Achilles' heel atm for some platforms). Good to know. Thank you again! ---------------------------------------------------------------------- TRon · 2024-07-22 05:35 Quote from: Aruna on July 22, 2024, 12:01:15 am Yes I would be very interested in how dbannon upgraded his Lazarus without installing everything manually. Just to make sure you did not miss it, I edited my post and added the url right beneath the horizontal line (sometimes that gets mistaken for a tagline) ---------------------------------------------------------------------- Aruna · 2024-07-22 09:29 Quote from: TRon on July 22, 2024, 07:35:06 amQuote from: Aruna on July 22, 2024, 12:01:15 am Yes I would be very interested in how dbannon upgraded his Lazarus without installing everything manually. Just to make sure you did not miss it, I edited my post and added the url right beneath the horizontal line (sometimes that gets mistaken for a tagline) Thank you. I did miss it thinking it was a tagline. I did wonder why is there a edit (*) in there but never gave it more thought ---------------------------------------------------------------------- Aruna · 2024-07-23 19:32 I followed user dbannon's instructions and now have a pristine install of Lazarus v3.4. Screenshot attached. I also ran: make bigide and now have all the missing components. Screenshot attached. I will close this thread as solved after I test drive the v3.4 ide and confirm everything works the way I want. Thank you everyone for al  your help and support.