Article View: borland.public.delphi.database
Article #1983Re: dynamic tablename in TQuery
From: Chris Townsend
Date: Mon, 08 Mar 1999 00:00
Date: Mon, 08 Mar 1999 00:00
36 lines
1600 bytes
1600 bytes
You might try sql.addstrings and build your select statement this way you
can assign tablename to a string variable sTablename
sql.addstring('SELECT *' )
sql.addstring('FROM '+sTablename)
Hope this helps.
Chris Townsend
Atlanta Georgia
townsend@bellsouth.net
Mario Verschuur wrote in message <7c07oo$g51$2@news2.xs4all.nl>...
>I'm trying to do a query on a specific table. But since I've got multiple
>tables ( for each year a paradox-table) I want to change the table I'm
using
>using the params property. But I'm getting an error "token : ?", which
would
>suggest that the parameters isn't substituted correctly.
>
>I was wondering if this is possible at all, and if possible how do I solve
>this problem. Since I wanted to continue my development I worked around the
>problem by editting the SQL property and replacing the tablename. But this
>isn't a very elegant solution.
>
>So anyone ??? Any help would be appreciated.
>
>--
>-------------------------------------------------
>Mario Verschuur
>Barendrecht, The Netherlands
>Email : Mario@Mediaport.Org
>
>
>
Technical Details
Message-ID:
<0tXE2.388$pD6.839759@news3.atl>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7c07oo$g51$2@news2.xs4all.nl>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 115d96,3f34fd4a08ac0774 X-Google-Attributes: gid115d96,public From: "Chris Townsend" <townsend@bellsouth.net> Subject: Re: dynamic tablename in TQuery Date: 1999/03/08 Message-ID: <0tXE2.388$pD6.839759@news3.atl> X-Deja-AN: 452716583 References: <7c07oo$g51$2@news2.xs4all.nl> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 NNTP-Posting-Date: Mon, 08 Mar 1999 16:40:12 EST Newsgroups: borland.public.delphi.database