我想使用TDbxReader实例生成报告,但找不到获取aReader.value [index]列名称的方法。有人可以帮帮我吗?
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;
此致 赫
答案 0 :(得分:2)
找到它。使用的是areader.dataType [index] .name