Mega Code Archive

 
Categories / Delphi / ADO Database
 

Using date as a field name

Question: I have a field called DATE and when I do a Query on the table with the SQL Statement SELECT DATE FROM "tablename.db" I get an error "Invalid use of Keyword. Token: DATA line 1" What is the problem? Answer: Never name a Field "Date". Date is a Keyword in SQL and therefore SQL statements that use the word in the wrong way will throw this error.