TMyQuery & Dynamic Query

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
tltmusashi
Posts: 5
Joined: Tue 06 May 2008 10:38

TMyQuery & Dynamic Query

Post by tltmusashi » Tue 06 May 2008 11:14

Hi

i need use dynamic querys, but when i doit this:

SQL

Code: Select all

SELECT * FROM agreement %s
CODE

Code: Select all

...
DefaultQuery := MyQuery1.SQL.CommaText;
...
MyQuery1.Active := False;
MyQuery1.SQL.Clear;
MyQuery1.SQL.CommaText := Format(DefaultQuery, ['WHERE 1=1']);//SAMPLE
MyQuery1.Active := True;
i see error message! ~"...SQL syntax is not right..."

сlean shielding query " a symbol, do shielding before sending query into server.

tltmusashi
Posts: 5
Joined: Tue 06 May 2008 10:38

Post by tltmusashi » Tue 06 May 2008 11:20

can you Crypt DB Fields?
can you Crypt SQL Strings?

it is view when i open my application by notepad.


thx.

tltmusashi
Posts: 5
Joined: Tue 06 May 2008 10:38

bug?

Post by tltmusashi » Wed 07 May 2008 05:26

bug?

when i put ConnectionDialog on the form and apply property

Code: Select all

...
MyConnection1.LoginPrompt := True;
...
and after run App, i see ConnectionDialog, why?
iam is`nt do

Code: Select all

...
MyConnection1.Connect();
...
MyDAC ver 5.20.1.14

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: TMyQuery & Dynamic Query

Post by Dimon » Wed 07 May 2008 14:18

tltmusashi wrote:i need use dynamic querys, but when i doit this:
SQL

Code: Select all

SELECT * FROM agreement %s
CODE

Code: Select all

...
DefaultQuery := MyQuery1.SQL.CommaText;
...
MyQuery1.Active := False;
MyQuery1.SQL.Clear;
MyQuery1.SQL.CommaText := Format(DefaultQuery, ['WHERE 1=1']);//SAMPLE
MyQuery1.Active := True;
i see error message! ~"...SQL syntax is not right..."
We could not reproduce the problem.
Please send a complete small sample to dmitryg*crlab*com to demonstrate it, including a script to create and fill a table.

Dimon
Devart Team
Posts: 2910
Joined: Mon 05 Mar 2007 16:32

Re: bug?

Post by Dimon » Wed 07 May 2008 14:27

tltmusashi wrote:when i put ConnectionDialog on the form and apply property

Code: Select all

...
MyConnection1.LoginPrompt := True;
...
and after run App, i see ConnectionDialog, why?
iam is`nt do

Code: Select all

...
MyConnection1.Connect();
...
Probably, you have set the MyConnection.Connected property to True in desingntime and therefore on running of the application MyConnection connects to MySQL server.

Post Reply