 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Martijn Tonies Guest
|
Posted: Tue Jan 13, 2004 11:07 am Post subject: ParamCheck = False, still parameters? |
|
|
Hi,
I'm wondering if this can be considered a bug...
Take a look at the source below, it comes from the Delphi 7
dbExpress component TSQLQuery.
Despite "ParamCheck = False", it still parses the text for
parameters when the text is set at design time. This modifies
the original SQL to include "?" instead of ":<something>".
When you are, for example, trying to create an InterBase
stored procedure, the text can contain ":<something>" that
should not be replaced by "?" cause it will fail. Setting
it at run-time fixes the problem, but this is a workaround.
Comments?
procedure TSQLQuery.QueryChanged(Sender: TObject);
var
List: TSQLParams;
begin
if not (csReading in ComponentState) then
begin
Close;
SetPrepared(False);
if ParamCheck or (csDesigning in ComponentState) then
begin
List := TSQLParams.Create(Self);
try
FText := SQL.Text;
List.Parse(FText, True);
List.AssignValues(FParams);
FParams.Clear;
FParams.Assign(List);
finally
List.Free;
end;
end else
FText := SQL.Text;
DataEvent(dePropertyChange, 0);
end else
FText := FParams.ParseSQL(SQL.Text, False);
SetFCommandText(FText);
end;
--
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
|
|
| Back to top |
|
 |
Craig Stuntz [TeamB] Guest
|
Posted: Tue Jan 13, 2004 1:33 pm Post subject: Re: ParamCheck = False, still parameters? |
|
|
Martijn Tonies wrote:
| Quote: | I'm wondering if this can be considered a bug...
|
I think so.
-Craig
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : http://delphi.weblogs.com
Useful articles about InterBase and Delphi development:
http://delphi.weblogs.com/articles
|
|
| Back to top |
|
 |
Martijn Tonies Guest
|
Posted: Tue Jan 13, 2004 3:37 pm Post subject: Re: ParamCheck = False, still parameters? |
|
|
"Craig Stuntz [TeamB]" <cstuntz (AT) nospam (DOT) please [a.k.a. vertexsoftware.com]>
wrote in message news:400401bc$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Martijn Tonies wrote:
I'm wondering if this can be considered a bug...
I think so.
|
QC 6903.
--
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com
|
|
| Back to top |
|
 |
C Clemans Guest
|
Posted: Wed Feb 18, 2004 3:01 pm Post subject: Re: ParamCheck = False, still parameters? |
|
|
Martijn:
I just put together a quick demo app of a form, SQLConnection, two
value list editors (VLE) and a button.
On the form create, the static params from the SQLConnection are loaded
into the first VLE. I edit the path in the first VLE to an "unknown"
IB db. Press the button and it and the parameters are loaded into the
Connection and the connection is opened. No error since it did not take
the edited strings as params. (the original path was valid.)
Press the button a second time and I get the error since it now took
the edited values.
Interesting.
Craig
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|