~~~~TntEdit,TntMemo等控件有bug嗎,怎麼當輸入的是漢字時只添加了一部分字進數據表裡去呢?那個字段是GoodsMemo 類型大小nvarchar(500)
finer 2008-09-04 09:00:52 procedure TgoodsForm.Button2Click(Sender: TObject);
begin
with ADOQueryNew do
begin
Close;
SQL.Clear;
SQL.Add('if not exists(select 1 from ut_Goods where GoodsNO=:z) ');
SQL.Add('insert into ut_Goods(GoodsNO,GoodsName,GoodsBar,GoodsUnit,SupplierNO,GoodsMemo) values(:a,:b,:c,:d,:e,:f)');
Parameters.ParamByName('z').Value:=Trim(Edit2.Text);
Parameters.ParamByName('a').Value:=Trim(Edit2.Text);
Parameters.ParamByName('b').Value:=Trim(Edit3.Text);
Parameters.ParamByName('c').Value:=Trim(Edit4.Text);
Parameters.ParamByName('d').Value:=Trim(Edit5.Text);
Parameters.ParamByName('e').Value:=Trim(Copy(TntComboBox1.Text,1,4));
Parameters.ParamByName('f').Value:=Trim(Memo1.Lines.Text);
ExecSQL;
ShowMessage('添加成功!');
end;
Button1.Click;
end;