Article View: borland.public.cppbuilder.database.ado
Article #5896Re: TADOCommand - changing CommandText ineffective
From: John R Young
Date: Thu, 04 Jan 2001 00:49
Date: Thu, 04 Jan 2001 00:49
35 lines
2335 bytes
2335 bytes
OK. I have looked at the source code !... property CommandText: WideString read FCommandText write SetCommandText; ... this appears to allow editing of the supoosedly private FCommandText in-situ using WideString.Delete and Insert, as I had done, via its exposure in the property. This changes the text without calling the AssignCommandText procedure which is needed to change the Command in the underlying ADO object. The remedy is to copy the wideString out, edit it and assign it back in. The latter uses SetCommandText which does call AssignCommandText. Am I missing something, or should this exposure of FCommandText be considered to be a bug? John R Young John R Young wrote: > > I am Using a TADOCommand to talk to MS SQL Server 7.0 (cppb 5) > At design-time, CommandText is "insert into xxx (column,....) values > (:parameter, ...." > I use a combobox to select target table name & replace "xxx" by, say, "yyy". > Inspecting CommandText with debugger immediately before the Execute() > statement shows "insert into yyy (column,....) values :parameter, ....", as > expected, but the insert goes into table xxx !!!??? Why? and what is the > remedy? > > Notes... > The TADOCommand is not connected through a TADOConnection. > It has Prepared=true (at design), and is not explicitly unprepared and > reprepared. > > Most grateful for any explanation. > John Young
Technical Details
Message-ID:
<3A53C880.3D447228@btinternet.com>Path:
arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mailReferences:
<92vd7h$sph8@bornews.inprise.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,f3a64747c836a201 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-01-03 16:53:36 PST Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!bornews.borland.com!not-for-mail From: John R Young <john.r.young@btinternet.com> Newsgroups: borland.public.cppbuilder.database.ado Subject: Re: TADOCommand - changing CommandText ineffective Date: Thu, 04 Jan 2001 00:49:04 +0000 Organization: John Young Lines: 35 Message-ID: <3A53C880.3D447228@btinternet.com> References: <92vd7h$sph8@bornews.inprise.com> NNTP-Posting-Host: host62-7-53-107.btinternet.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en