开发者

How to get the columns' names in a TDbxReader instance

I w开发者_如何学JAVAant to make a report with a TDbxReader instance but don't find the way to get the name of aReader.value[index] column. Somebody could help me?

  aCmnd.Text := 'SELECT * FROM Country'; 
  aCmnd.Prepare; 
  aReader := aCmnd.ExecuteQuery; 

  aColCount := aReader.ColumnCount; 
  Writeln( 'Results from Query: ' + aCmnd.Text ); 

  // write column headers, but don´t know column names
  for iColumn:= 0 to aColCount -1 do 
    Write(aReader.Value[iColumn].name + '  '); //would like unexistent name property
                                               //How can I do something like this?     
  writeln;
  while aReader.Next do 
  begin 
    for iColumn:= 0 to aColCount -1 do  
      Writeln( aReader.Value[iColumn].GetAnsiString + '  '); //assume string fields
  end; 

Regards, Hector


Found it. Used areader.dataType[index].name

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜