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:

  1. set adoconnection's provider property 'sqloledb', and
  2. set adoquery's cursorlocation property cluseserver.

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -