mischmasch
Programmer
- May 10, 2011
- 11
Hello,
I'm traying to Update my table by using SQL command but all the time occures some error.
My code is simple:
with ADOQuery_PasswordChange do
begin
Connection:=ufMain.ADOConnection1;
SQL.Clear;
SQL.Text:='UPDATE tblAccount SET Password=''' + 'XXX' + ''' WHERE UserID=''' + 'AAABBB' + ''';';
ExecSQL;
end;
Delphi, I don't know how and why, adds some additional characters #$D#$A to my SQL.Text.
Instead of this
UPDATE tblAccount SET Password='XXX' WHERE UserID='AAABBB';
there is
UPDATE tblAccount SET Password='XXX' WHERE UserID='AAABBB';#$D#$A
and when ExecSQL is executed, I receive error.
I've tried to use Trim function but unsuccessfully.
Anyone knows how to solve this problem?
In Unit I have many similar commands and only at the end of this line Delphi adds this characters, why? I don't see anything special in this line.
I'm traying to Update my table by using SQL command but all the time occures some error.
My code is simple:
with ADOQuery_PasswordChange do
begin
Connection:=ufMain.ADOConnection1;
SQL.Clear;
SQL.Text:='UPDATE tblAccount SET Password=''' + 'XXX' + ''' WHERE UserID=''' + 'AAABBB' + ''';';
ExecSQL;
end;
Delphi, I don't know how and why, adds some additional characters #$D#$A to my SQL.Text.
Instead of this
UPDATE tblAccount SET Password='XXX' WHERE UserID='AAABBB';
there is
UPDATE tblAccount SET Password='XXX' WHERE UserID='AAABBB';#$D#$A
and when ExecSQL is executed, I receive error.
I've tried to use Trim function but unsuccessfully.
Anyone knows how to solve this problem?
In Unit I have many similar commands and only at the end of this line Delphi adds this characters, why? I don't see anything special in this line.