Recent

Author Topic: Why it not work? KOL-CE  (Read 7509 times)

Neoc

  • Newbie
  • Posts: 2
Why it not work? KOL-CE
« on: August 18, 2010, 12:08:11 pm »
KOL-CE Application, ComboBox1 is TKOLComboBox .
dbf1: TDBF

dbf1.Edit;
dbf1.FieldbyName('CurrentStatus').AsString := ComboBox1.Text;
dbf1.FieldbyName('CurrentID').AsInteger := 1;
dbf1.Post;

dbf1.FieldbyName('CurrentID').AsInteger := 1; This line worked, but
dbf1.FieldbyName('CurrentStatus').AsString := ComboBox1.Text; not work.
Why?

Thanks!

Neoc

  • Newbie
  • Posts: 2
Re: Why it not work? KOL-CE
« Reply #1 on: August 19, 2010, 12:24:58 am »
ComboBox1.Text is a chinese word.
ComboBox1.Text is KOLString, must change to string?
dbf1.FieldByName('CurrentStatus').AsString := WideCharToString(PWideChar(ComboBox1.Text)); it still doesn't work.

Anybody tell me why?
Thanks!
« Last Edit: August 19, 2010, 12:27:19 am by Neoc »

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3541
Re: Why it not work? KOL-CE
« Reply #2 on: August 19, 2010, 12:49:58 pm »
Try this:

dbf1.FieldbyName('CurrentStatus').AsString := UTF8Encode(ComboBox1.Text);