Re: Used a reserved word in a field name.....
- From: Jon Purvis <jon.purvis@xxxxxxxxxxxxxxxx>
- Date: Mon, 25 Feb 2008 16:04:33 -0600
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
.
- References:
- Used a reserved word in a field name.....
- From: Ian Groves
- Used a reserved word in a field name.....
- Prev by Date: Re: Used a reserved word in a field name.....
- Next by Date: Re: Used a reserved word in a field name.....
- Previous by thread: Re: Used a reserved word in a field name.....
- Next by thread: Re: Used a reserved word in a field name.....
- Index(es):
Relevant Pages
|