delphi - How to use .Locate when column name is a keyword -
using xe5 , ado, how can use tadoquery.locate
when column name key word?
for example, have table has column named desc
, keyword.
the code below generates runtime error (exception class eoleexception
message arguments of wrong type, out of acceptable range, or in conflict 1 another
):
adoqueryqp1.locate('desc', 'findme', [])
i've tried [] , double quotes around desc
.
with [desc]
or "desc"
(single or double quotes), exception class edatabaseerror
message adoqueryqp1: field '[desc]' not found
.
related question else in 2012: selecting column name reserved sql keyword
see if following workaround acceptable you:
- set adoconnection's
provider
property'sqloledb'
, and - set adoquery's
cursorlocation
propertycluseserver
.
Comments
Post a Comment