Forum
× Components and Libraries for Database Development, discussions, problems and suggestions

Question DBGrid does not return fieldname from Column[0] CT6.8

  • Jose Ceravolo
  • Topic Author
  • Away
  • Fresh Boarder
  • Fresh Boarder
More
1 week 1 day ago #13744 by Jose Ceravolo
Hi Guys,

This is a weird one.
I created a little program to import CSV into my database and it works for the most part.
The only weird thing is that when I try to get and field name for Column[0] it does work the first time I run the procedure.
It also does not raise an exception.
The second time, it works...
Here's the code excerpt.

for ncount := 0 to dbgImport.Columns.Count - 1 do
begin
currentfield := dbgImport.Columns[ncount].FieldName; ============>>> does not return for Column[0], that should be field Column1 it does return all the other columns.

if UpperCase(dsImport.DataSet.FieldByName(currentfield).asString) = 'NAME' then
begin
isFullName := true;
fullnamefield := currentfield;
end;
end;

I hope the error is mine, but I can't see it.

Thanks,

Jose.

Please Log in or Create an account to join the conversation.