如果时访问字符串中的字符的话,就简单的方法就是 str: String Str := FieldByName('fieldname').asstring for I:= 1 to Length(Str) do begin Str[i] end;
我想任意应该还是你想要的某个记录中的这个字段的置 假设你用关键字段id来区别 如下: pid:integer; str:string; begin pid:=XXXXX;//你想要的某个记录的id的值 if not table1.locate('id',pid,[]) then begin showmessage('have not found'); exit; end; str:=table1.fieldbyname('你想取值的字段名').asstring;
再用copy((n-1),1)獲得每一個數据.
str: String
Str := FieldByName('fieldname').asstring
for I:= 1 to Length(Str) do
begin
Str[i]
end;
假设你用关键字段id来区别 如下:
pid:integer;
str:string;
begin
pid:=XXXXX;//你想要的某个记录的id的值
if not table1.locate('id',pid,[]) then
begin
showmessage('have not found');
exit;
end;
str:=table1.fieldbyname('你想取值的字段名').asstring;
在 str:=table1.fieldbyname('你想取值的字段名').asstring;
前加 table1.setkey;
后加 table1.gotokey;
其实不加也行