Unable to find the component TDataSource with Lazarus 2.2 lazarus / 16-Databases ---------------------------------------------------------------------- tintinux · 2022-08-11 12:57 Hi When loading a .lfm, I get this message : Unable to find the component class "TDatasource". It is not registered via RegisterClass and no lfm was found. It is needed by unit:  (the unit I load) This occurs with Lazarus 2.2, not with 2.0.x I used previously. Other .lfm in my project contain a visual TDataSource and load without problem. What should I check or change ? Thanks ---------------------------------------------------------------------- HeavyUser · 2022-08-11 14:52 1) open the components dialogue/palette and see if the tdatasource is listed in there to rule out something wrong with your installation. 2) compress and attach the problematic unit and its lfm so we can take a look. I'm assuming some short of problem with the type name where the letters might look the same but are comprised from the English letters expected, it can happen after a manual editing of the lfm or the pas file. You can try to manually delete the component from the lfm and unit and re-add it anew. ---------------------------------------------------------------------- tintinux · 2022-08-11 17:30 Hi The TDataSource is present in the palette and looks correctly installed. Other similar units having a TDataSource in the .lfm load without problem. The .pas and .lfm are attached. The .lfm was renamed to .lfm.txt since this forum doesn't allow .lfm uploads  The full project is Gestinux/trunk and can be found on SourceForge. ---------------------------------------------------------------------- Nicole · 2022-08-11 18:15 in doubt, do this: Right click to the white area of your components, choose "show all". There you can key in anything which tries to hide away. Like "datasource". ---------------------------------------------------------------------- HeavyUser · 2022-08-11 18:40 Sorry, I do not see anything wrong with your files. It should work. The only thing I can think off to do, is to open the lfm in a text editor and delete the datasource from it (all 4 lines), also delete it from the pas file and see if that opens the form correctly. If it does, then add it again. ---------------------------------------------------------------------- tintinux · 2022-08-12 06:17 Quote from: Nicole on August 11, 2022, 08:15:31 pmin doubt, do this: Right click to the white area of your components, choose "show all". There you can key in anything which tries to hide away. Like "datasource". Sorry, I don't understand what you want me to do. Remember that I can't load the form and see any visual component. ---------------------------------------------------------------------- tintinux · 2022-08-12 06:23 Quote from: HeavyUser on August 11, 2022, 08:40:49 pmSorry, I do not see anything wrong with your files. It should work. The only thing I can think off to do, is to open the lfm in a text editor and delete the datasource from it (all 4 lines), also delete it from the pas file and see if that opens the form correctly. If it does, then add it again. Ok, it is what I did, and it works. However, this is very weird. I reduced the difference between bad and good file to the indice following the Datasource component in the .lfm. The indice order are exchanged and everything else is the same. The "bad" file doesn't load, the "ok" does, it is reproductible. ---------------------------------------------------------------------- Nicole · 2022-08-23 10:49 Workaround: This happens to me now and then with various components (version 2.22) I do this: I add the type of component again. This makes the uses clauses (or something else as well?) rewritten, and the error message is gone. Usually. The mess has to be deleted because nobody likes strange components which are only dummies. After deletion of them, the error comes back in rare cases. Mostly it is gone. ---------------------------------------------------------------------- Nicola Gorlandi · 2022-08-27 06:02 Hi had the same issue and it was because in the lfm the class of object was wirtten with different case. Example from object DBcodice: TK6DBEdit[2] to object DBcodice: Tk6dbedit[2] The right version has to be taken from the RegisterComponents('NicoSoft', [Tk6dbedit]). Hope it helps ---------------------------------------------------------------------- Thaddy · 2022-08-27 08:32 If the TDatasource is in another unit, include that unit in the uses clause?