delphi 字符串转换问题
for i :=2 to ExcelRowCount do
begin
if length(trim(Sheet.Cells[i,1 ].Value)) <=0 then break;
With ADOQuery1 do
begin
close;
SQL.Clear;
SQL.text:=('Select * from ICSale where FHeadSelfI0461= '''+ strtointDef(Sheet.Cells[i,1].Value,0)+'''');
因为字符段是int型的,而导入的excel 第一行为标题行,无法把列属性改为数值型,之前报错,把sql.add 转换为sql.text 正常了,但是需要把字符类型改为int型,用strtoint 或者strtointdef 都报错
[错误] Unit1.pas(91): Incompatible types: 'String' and 'Integer' excel里面绝对是int型数据