- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
void TDataModule1::GetUniqueValues(TStringList* buffer, AnsiString columnName) {
AnsiString icn = columnName.Trim();
AnsiString sqlQuery = "SELECT ["+icn+"] FROM [index] ORDER BY ["+icn+"];";
adq->Close();
adq->SQL->Clear();
adq->SQL->Add(sqlQuery);
adq->Open();
AnsiString lastValue = "";
AnsiString nextValue = "";
while(!adq->Eof) {
nextValue = adq->FieldByName(icn)->AsString.Trim();
if(nextValue!=lastValue) {
buffer->Add(nextValue);
lastValue = nextValue;
}
adq->Next();
}
adq->Close();
}
CrashTesterAnusov 03.10.2016 16:08 # −1465