Re: Used a reserved word in a field name.....



Ian Groves wrote:
I have a MS Access Database and use TADODataset.commandtext and use a JET connection to run....

SELECT * FROM Containers WHERE Number > 10

Of course this fails as I have used the field name NUMBER, aside from restructing the table and my app how can i get around this?

I have tried

SELECT * FROM Containers WHERE [Number] > 10
SELECT * FROM Containers WHERE "Number" > 10
SELECT * FROM Containers WHERE 'Number' > 10

with no luck.

I just created a table Named Containers with a single field named Number (type integer) in an existing Access 2002 database table. Within Access, and within a TADOQuery sql string, "select * from containers where number>5" returned the correct rows. Placing [] around the table or field name had no effect - it always worked. So, it should work for you - must be something else going wrong.

--
Jon Purvis
Wildlife Technical Programs Lead
Texas Parks and Wildlife Department
Austin, TX
.



Relevant Pages

  • Re: Used a reserved word in a field name.....
    ... connection to run.... ... SELECT * FROM Containers WHERE Number> 10 ... Of course this fails as I have used the field name NUMBER, ... Ian Groves ...
    (borland.public.delphi.database.ado)
  • Re: C/R without "leaks"
    ... sshd: to give up the connection when something goes wrong. ... server consolidation with a virtual machine, your do with containers. ...
    (Linux-Kernel)
  • Used a reserved word in a field name.....
    ... I have a MS Access Database and use TADODataset.commandtext and use a JET ... connection to run.... ... SELECT * FROM Containers WHERE Number> 10 ...
    (borland.public.delphi.database.ado)