Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching for an SQL string in delphi TQuery Components

Status
Not open for further replies.

tbarone

Programmer
Aug 1, 2001
13
0
0
US
I have a Delphi project with tons of forms. It is a Retail point of sale program. Every once in awhile when it is running, I get a 'Select * from Transactions' query in my SQL log. this query should never be run because this table is huge. I try to search the project for 'Select * from Transactions' but get nothing back. So I am guessing that this string has to be in one of the TQuery components under SQL. Is there anyway to search all the TQuery components in the project to find out what is in the SQL string property? If not is there another text search program i can use to possibly search through them?

Thanks,
Tony
 
hi

Search all the .dfm files from Windows File Explorer and put the 'select * from ..' in the Containing text field.

lou

 
Thanks for the suggestion. I tried it but no luck. Is there anywhere else in the Delphi project where this SQL can possibly be coming from?

Thanks,
Tony
 
Oh, it worked for me. Did you get the search string exactly right?

 
Are your .dfm files set to "Text"?

You don't say which version of Delphi you're using, but versions 4 and below had binary .dfm files, version 5 had the option to do either binary or text. I'm not sure about the more recent versions as I use v5 at work.

If they're binary, you might want to see if you can get an evaluation copy of Multi-Edit which will do a search on .dfm files by automatically converting them to text while it's searching. You can find it at
-D
 
Im sorry, i think you misunderstood. The search thing worked, but I just did not find that exact string. Is there anywhere else in delphi where sql can be execyted other than the actual code and the TQuery components?

Thanks,
Tony
 
I would look for 'sql.text' or 'sql.add' keywords since you can build it up dynamically, this can be done through tquery but also through a connection component.


--------------------------------------
What You See Is What You Get
 
Also try searching (in Find in Files) on the 2 options, ie. 'Files in Project' and 'Search in Directories'. Maybe just search on the Table name and check the 'whole words' option.

lou

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top