B.S. Delphi SQL Error? 
Author Message
 B.S. Delphi SQL Error?

Quote:

>  Hello, all.  here's my problem.  I'm building a Delphi project with Delphi
>4 to access a Microsoft Access database.  I'm using a TQuery component to run
>a query and populate a querygrid.  After writing the SQL for the query
>component I try to make it active.  I keep getting an error message to this
>effect: "Invalid use of keyword.  Token: transaction."trantype" ......"  Now
>at first I started out with a pretty complex query.  Then, just for fun, I
>tried this one:

>select
>    transaction."trantype"
>from transaction;

>I tried this query in Access.  It worked without any problems, like it should.
>Then I inserted this EXACT query into my TQuery component and tried to make it
>active.  Here's the EXACT error message I got:

>Invalid use of
>keyword.
>Token: transaction."trantype"
>from
>Line Number: 2

>  Then I tried reinstalling Delphi 4.  I opened up the project and tried
>activating the query.  Same deal.  Has anyone else had this problem?  I've
>written quite a few queries, alot of them more complex than this.  The error
>message I get when I try to activate the query strikes me as being a bullshit
>error message.      Please help me.  My {*filter*} pressure is very high now, and I
>want to kill someone.

The word "TRANSACTION" is recognized by the BDE as a reserved word. Since
the BDE appears to be evaluating this SQL statement before passing it on to
the Jet engine, I would assume you have the TQuery.RequestLive property set
to True. Is this the case? If so, try the same query with the same SQL but
with the RequestLive property set to False.

Words the BDE recognizes as reserved word are listed in the local SQL
online help file, LOCALSQL.HLP, found in the main BDE directory. Look in
the index for the topic "Reserved words".

One thing you might try is quoting the table name and then prefixing the
column name with a table correlation name.

  SELECT T."trantype"
  FROM "transaction" T

//////////////////////////////////////////////////////////////////////////
Steve Koterski                 "Like a camel, I can go without a drink for
Technical Publications         seven days--and have on several horrible
INPRISE Corporation            occasions."
http://www.***.com/ ;                               -- Herb Caen



Wed, 18 Jun 1902 08:00:00 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Free of B.S.

2. [BS] - Informatica - PROGRAMMATORE VB 6.0 E SQL SERVER

3. SQL error codes / Delphi 3 error codes

4. Delphi:Paradox vs Delphi:SQL Anywhere vs Delphi:FoxPro via Apollo

5. Java/CORBA and Adabas/Natural on BS/2000

6. Programmer wanted in BS-Germany

7. BS/1 Source Code

8. Designing queries and other VB BS

9. 10 year BS!

10. data from DB in BS 2000 with ERWIN?

11. DELPHI with SYBASE SQL ANYWHERE------ DELPHI with SYBASE SQL ANYWHERE

12. Delphi...Delphi....Delphi - New Delphi Site


 
Powered by phpBB® Forum Software