Recent

Author Topic: Renamed a TSQLQuery component  (Read 389 times)

CraigC

  • Jr. Member
  • **
  • Posts: 78
Renamed a TSQLQuery component
« on: April 18, 2026, 09:07:01 pm »
I renamed a TSQLQuery component and Lazarus is still claiming it's under it's old name.

tblInventory_  is not tblInventory   I removed the "_".  Lazarus tried to rename a lot of the instances of the old spelling.  I went through and changed others. Did a clean and build and it compiled with the underscore.  When using the code complete it still showed the name with the underscore.  Searched the entire project and removed all of the underscores.  Lazarus is still claiming the underscore is correct. 

I'm doing this because when the app goes to open the query, I get an error. External:SIGSEGV  I Googled it and I don't know that to look for.  It only happens on the one query at run time.  At design time, it opens without an error and if I copy the component to another datamodule I don't get the error.

Lazarus 4.6, Linux Mint, SQLite

Any ideas?

Thaddy

  • Hero Member
  • *****
  • Posts: 19175
  • Glad to be alive.
Re: Renamed a TSQLQuery component
« Reply #1 on: April 18, 2026, 10:17:24 pm »
HOW did you rename it? By hand? (Usually extremely Bad) or through the object inspector(Good)? Or with the refactor option ctrl-shift-E(xtremely good)?
What happens here is that the lfm still contains the old name....

If you manually rename, lfm and sourcecode are not synced anymore unless you really know what you are doing, basically do what the good options do behind the scene: synchronize.

To repair, give it back the old name, select it, press ctrl-shift-E, follow the dialog. Or rename from the object inspector, but that will not refactor/rename if the component is used in other units in your project.
« Last Edit: April 18, 2026, 10:31:13 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

CraigC

  • Jr. Member
  • **
  • Posts: 78
Re: Renamed a TSQLQuery component
« Reply #2 on: April 18, 2026, 10:33:06 pm »
I always start with the object inspector. I found it interesting that Lazarus changed several references but not all.

I still have to figure out the error and or change the component?  When I added a copy of the query to another datamodule, it opened with no issues. Odd.

Thaddy

  • Hero Member
  • *****
  • Posts: 19175
  • Glad to be alive.
Re: Renamed a TSQLQuery component
« Reply #3 on: April 18, 2026, 10:54:18 pm »
Try the refactor dialog option: it can see all occurrences in a project, unlike the object inspector.

Your screenshots clearly demonstrate the lot was out of sync.
« Last Edit: April 18, 2026, 10:55:52 pm by Thaddy »
objects are fine constructs. You can even initialize them with constructors.

CraigC

  • Jr. Member
  • **
  • Posts: 78
Re: Renamed a TSQLQuery component
« Reply #4 on: April 18, 2026, 11:14:18 pm »

I have used that.  When there is a lot of occurrences, that is the way to go.

Thank you.

 

TinyPortal © 2005-2018