Hello!
I am writing a procedure for exporting data from Excel file to SQL database.
My question id how to determine cell data type in worksheet, if it is generally possible?
Some fields are strings but contains numbers and some are pure floats.
I do it like this:
for j:=0 to MyWorksheet.GetLastColNumber do begin
try
f := MyWorksheet.ReadAsNumber(i,j);
s := s + FloatToStr(f)+',';
except
s := s+''''+MyWorksheet.ReadAsUTF8Text(i,j)+''',';
end;
end;
but sometimes it fails because strings with numbers only are threaten as floats and strings with letters are read as '0'.
Therefore I need to distinguish pure floats, then convert it string, then replace coma with dot and put to SQL script.
Please help.
Regards,
Krzysztof