Solved

TQuery

Posted on 1998-11-15
1
233 Views
Last Modified: 2010-04-04
At runtime I want to use a query to find the sum of a table field called value. I don't know the table name until runtime. I've tried using the Param method to set the table name, but Delphi won't play ball. Anyone got any ideas. Thanks.
0
Comment
Question by:cavalry
1 Comment
 
LVL 1

Accepted Solution

by:
EmmDieh earned 20 total points
Comment Utility
You can't use a parameter for the table name. The middle layer
can't prepare the SQL-Statement
You'll have to build the query during runtime with someting
like
SQL.Clear;
SQL.Add('select count(Field) from');
SQL.Add(TableName);


0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now