Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My field name is "domain" - SQL Query problem

Status
Not open for further replies.

worldwise

Programmer
Jun 1, 2005
112
US
Hi,

I have an Access backend with a field named 'domain'. I guess this must be a reserved word/keyword because I'm running into problems when running a query on the DB.

SELECT * FROM myTable WHERE domain = 'blah'

the error that comes back is: Unspecified Error.

I thought it might help to quantify the field by going: myTable.domain but I get the same error.

Is there any workaround? I have already built many pages using this field so changing the field name from 'domain' is really not an option.

Thank you,

-Kevin
 
domain isn't a reserved word for Access or SQL Server

Access Reserved Words:

SQL Server:

You will need to debug your code to determine where the failure actually occurs.. is it the connection or is it the SQL statement - try running the SQL statement directly in Access. Also if you are generating it dynamically, response.write the result and make sure that it is what you expect it to be.

A smile is worth a thousand kind words. So smile, it's easy! :)
 
show us your actual query...havent come across the word domain referred to as a keyword...there might be problem somewhere else...

-DNG
 
When I put brackets around the word, it works.

SELECT * FROM myTable WHERE domain = 'blah' <--ERROR

SELECT * FROM myTable WHERE [domain] = 'blah' <-- WORKS!!!


It must be a reserved word then. But whatever the reason, its works now so I'm good! Thanks everyone for your posts!

-Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top