Hi, Developer,
Do you know there is a the difference in Delphi2009: TField.AsString and TField.Value,
I tested it and Result is :
----------------------------------------------------
function TStringField.GetAsString: string;
begin
Result := string(GetAsAnsiString);
end;
----------------------------------------------------
----------------------------------------------------
function TStringField.GetAsVariant: Variant;
var S: AnsiString;
begin
if GetValue(S) then Result := S
else Result := Null;
end;
----------------------------------------------------
So ,you know VarType(TField.Value) = 256 VarType(TField.AsString) = 258,
Please check your code which prepare Params before execute sql.
When I run in delphi2009, then Param Size is not enough,
now is : "中国" size is varchar(2),
to tell your the truth the size is varchar(4)
I am looking forward to hearing from you.
Thank you in advance.
Unidac serious bug in Delphi2009
Step1.
create a table in MS SQL SERVER:
Create table tblDEMO ( AField varchar(10))
Step2.
Under Delphi2009, Use TUniQuery to Open this table tblDEMO,
Data Control use DBGrid.
Step3.
In DBGrid, append a record enter value '中国', then post it.
Step4
Refresh or reopen the table tblDemp, Only '中' stored.
My OS (XP) lauguage is simplify-chinese .
create a table in MS SQL SERVER:
Create table tblDEMO ( AField varchar(10))
Step2.
Under Delphi2009, Use TUniQuery to Open this table tblDEMO,
Data Control use DBGrid.
Step3.
In DBGrid, append a record enter value '中国', then post it.
Step4
Refresh or reopen the table tblDemp, Only '中' stored.
My OS (XP) lauguage is simplify-chinese .