2010-10-10 39 views
2

我想用TDbxReader實例生成報告,但沒有找到獲取aReader.value [index]列名稱的方式。有人可以幫助我嗎?如何獲取TDbxReader實例中的列名稱

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; 

問候, 赫

回答

2

找到它。二手areader.dataType [index] .name

相關問題