bazzer747 25 Posted March 4, 2023 Hi, I use MSSQL for my database and Firedac as an access method. I have a field called 'AccessLevel' in a table which is now redundant so I'm trying to remove it. I don't use this field anywhere in my project and a search in 'Find in Files' show's that it isn't referenced in any of the code. Also, in the query I use to select all fields from the table it is in I have deleted the field from the Fields Editor. I've renamed the field to 'AccessLevelX' in MSSQL Server (just in case!) When I run the project I get an Exception EDatabseError in module .... Field 'AccessLevel' not found. I can only think there's a reference in the database module where the query exists, but if in the database module I try to 'View as Text' I get a message: 'Module 'nameof module.pas' has open descendants or linked modules. Cannot close'. I'm not sure where I can go now, if someone has a thought as to a 'correct' procedure for removing unwanted/unused fields I'd appreciate some guidance. Share this post Link to post
bazzer747 25 Posted March 4, 2023 I've opened the data module outside Delphi in Notepad++ and there's no reference to 'AccessLevel'. So I'm now confused why I'm getting and error message for a field that doesn't exist in the project (that I can find!) Share this post Link to post
Uwe Raabe 2057 Posted March 4, 2023 Just now, Stano said: I would also check the dfm file. Extend that to all dfm files. Share this post Link to post
programmerdelphi2k 237 Posted March 4, 2023 (edited) in rare moments this happens to me, then, I have a form that always works: if necessary copy your SQL expression... delete (not COPY/PASTE) the FDQuery, save the project, and re-add the FDQuery (new component)! I think the reference is in the project's resource file, but I'm not sure as it's a binary file! *.RES Edited March 4, 2023 by programmerdelphi2k Share this post Link to post
Hans J. Ellingsgaard 21 Posted March 4, 2023 It can also happen if you have DB aware components that reference to that field. It could be on a different form. Share this post Link to post
programmerdelphi2k 237 Posted March 4, 2023 (edited) it's rigth! really if yourS forms had any reference these fields in "Design-time", for sure this can happens. in my case, I had only 1 form... producing this anomaly Edited March 4, 2023 by programmerdelphi2k Share this post Link to post