Board index » delphi » Using TQuery and an alias problem

Using TQuery and an alias problem

I am using Delphi 4.  I have on a form a TQuery component and a query
inthe SQL property of the TQuery.

The query works like this " select * from c:\somedir\table1.db"

I do have an alias set up in the BDE.  How do I use the alias/make sure
that the table is not hardcoded so that I can have safe installs on
users computers?
THanks

--
-----------------------------------------------------------
Patrick Sabourin B.Sc. (Comp. Sci.)
email: patrick_sabou...@technologist.com
web site: http://surf.to/patrick-sabourin

"Even a mosquito doesn't get a slap on the back until
 he starts to work."
                     -Unknown
-----------------------------------------------------------

 

Re:Using TQuery and an alias problem


Set the database property of TQuery to the name of your alias. If the alias
exists on your end-user's machine, your query will work. Use InstallShield
Express to set-up the alias and deploy your app.

--

Alain Quesnel

P.S.: remove the [brackets] from my address if you wish to reply by e-mail.

Quote
Patrick Sabourin wrote in message <37FD5364.CC387...@technologist.com>...
>I am using Delphi 4.  I have on a form a TQuery component and a query
>inthe SQL property of the TQuery.

>The query works like this " select * from c:\somedir\table1.db"

>I do have an alias set up in the BDE.  How do I use the alias/make sure
>that the table is not hardcoded so that I can have safe installs on
>users computers?
>THanks

Re:Using TQuery and an alias problem


On Thu, 07 Oct 1999 21:13:56 -0500, Patrick Sabourin

Quote
<patrick_sabou...@technologist.com> wrote:
>I am using Delphi 4.  I have on a form a TQuery component and a query
>inthe SQL property of the TQuery.

>The query works like this " select * from c:\somedir\table1.db"

>I do have an alias set up in the BDE.  How do I use the alias/make sure
>that the table is not hardcoded so that I can have safe installs on
>users computers?

To use an explicit driver an directory reference as part of the table
reference in a local SQL statement, it must be enclosed in quotation marks
(single or double).

  SELECT *
  FROM "c:\somedir\table1.db"

Alternately, you can use the name of a BDE alias. Enclose the alias name in
colons. Prefix the table name with the alias reference. Then enclose that
entire combination in quotation marks. For example:

  SELECT *
  FROM ":DBDEMOS:Country.db"

Local SQL (what the BDE uses for dBASE, Paradox, and FoxPro tables) is
documented in the online help file LOCALSQL.HLP, found in the main BDE
directory. This help file is a language reference of the local SQL
implementation (subset) of SQL-92. The copy of this file that came with BDE
4.x (and earlier versions) was outdated and has since been rewritten.
Updated copies will have the topic "Unsupported language" in the index (and
lack of this topic indicates a pre-update copy). I can e-mail you a copy of
the updated file if you need and desire it.

Your particular questions are addressed in this local SQL help file.

==========================================================================
Steve Koterski                  "Computers are useless. They can only give
Technical Publications          you answers."
Borland                                       -- Pablo Picasso (1881-1973)
http://www.borland.com/techpubs/delphi

Re:Using TQuery and an alias problem


Sure, you can email me the updated help files for Delphi 4.

My email address is posted with my posts in the newsgroup.
Thanks

Quote
Borland wrote:
> On Thu, 07 Oct 1999 21:13:56 -0500, Patrick Sabourin
> <patrick_sabou...@technologist.com> wrote:

> >I am using Delphi 4.  I have on a form a TQuery component and a query
> >inthe SQL property of the TQuery.

> >The query works like this " select * from c:\somedir\table1.db"

> >I do have an alias set up in the BDE.  How do I use the alias/make sure
> >that the table is not hardcoded so that I can have safe installs on
> >users computers?

> To use an explicit driver an directory reference as part of the table
> reference in a local SQL statement, it must be enclosed in quotation marks
> (single or double).

>   SELECT *
>   FROM "c:\somedir\table1.db"

> Alternately, you can use the name of a BDE alias. Enclose the alias name in
> colons. Prefix the table name with the alias reference. Then enclose that
> entire combination in quotation marks. For example:

>   SELECT *
>   FROM ":DBDEMOS:Country.db"

> Local SQL (what the BDE uses for dBASE, Paradox, and FoxPro tables) is
> documented in the online help file LOCALSQL.HLP, found in the main BDE
> directory. This help file is a language reference of the local SQL
> implementation (subset) of SQL-92. The copy of this file that came with BDE
> 4.x (and earlier versions) was outdated and has since been rewritten.
> Updated copies will have the topic "Unsupported language" in the index (and
> lack of this topic indicates a pre-update copy). I can e-mail you a copy of
> the updated file if you need and desire it.

> Your particular questions are addressed in this local SQL help file.

> ==========================================================================
> Steve Koterski                  "Computers are useless. They can only give
> Technical Publications          you answers."
> Borland                                       -- Pablo Picasso (1881-1973)
> http://www.borland.com/techpubs/delphi

--
-----------------------------------------------------------
Patrick Sabourin B.Sc. (Comp. Sci.)
email: patrick_sabou...@technologist.com
web site: http://surf.to/patrick-sabourin

"Even a mosquito doesn't get a slap on the back until
 he starts to work."
                     -Unknown
-----------------------------------------------------------

Other Threads