× 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
  • Offline
  • Junior Member
  • Junior Member
2 years 9 months 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
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
isFullName := true;
fullnamefield := currentfield;

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



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