不是字段类型造成的,昨天傍晚这个错误莫名奇妙的解决了,但我依然不清楚原因。我前面给出的代码概述是将calculate放到一个循环中,因为我有很多测量传感器,而这些传感器的通信和解析方式是一样的。原来大概是这样的:
for i:=0 to NodeCount-1 do
begin
NodeNum:= i;
calculate;
ds.insert;
...
end;
后来我改成这样:
for i:=0 to NodeCount-1 do
begin
NodeNum:=i;
calculate;
end;
for i:=0 to NodeCount-1 do
begin
ds.insert;
...
end;
Without looking at your code I can tell you that you are getting this error because you are trying to put a string into a VARCHAR field that is too long. So, for example you are trying to put a 60 char string into a VARCHAR(50) field.
Thanks your explanation. I it helped me solve the same error