Re: Filername ?
- From: "BRoberts" <berdontemail@xxxxxxxxxx>
- Date: Wed, 22 Oct 2008 20:37:03 -0400
"Stark" <franco.jommi@xxxxxx> wrote in message news:48fbb50e$0$1074$4fafbaef@xxxxxxxxxxxxxxxxxxxxxx
In the statement: Select * from "MyDatase.dbf" "MyDataset.dbf" needs to be the actual filename on disk.
Since I need to apply the same Select statement to different datasets (on disk I name them with a suffix like MyDataset_1, .._2, etc.), how can I do it ?
A normal Table, would allow me to set programmatically a different Tablename .. But with a TQuery, while I can set Databasename, there is no property correspondig to Tablename.
You could use query parameters. What I often do is construct a simple function to return the query text, something like
function setQueryTableName (const tblName, qryText : string) : string;
begin
result := StringReplace (qryText, '@TableName', tblName, [rfReplaceAll, rfIgnoreCase]);
end;
.
- References:
- Filername ?
- From: Stark
- Filername ?
- Prev by Date: Re: Inherited explained
- Next by Date: Extract interface from closed library ?
- Previous by thread: Re: Filername ?
- Next by thread: Inherited explained
- Index(es):
Relevant Pages
|