用ADO连接上了数据源,怎样对数据源中的某一表的字段建立索引.在下段源码中如何建立呢?AConnection := CreateOleObject('ADODB.Connection');AConnection.Open('Provider=MSDASQL.1;Persist Security Info=False;Data Source=GisPipe');
{建立一个数据集对象并从数据表中提取数据}ARecordSet := CreateOleObject('ADODB.RecordSet');ARecordSet.open( 'pipevalue',AConnection,adOpenStatic,adLockOptimistic,adCmdTable );
{建立一个数据集对象并从数据表中提取数据}ARecordSet := CreateOleObject('ADODB.RecordSet');ARecordSet.open( 'pipevalue',AConnection,adOpenStatic,adLockOptimistic,adCmdTable );
ARecordSet.Sort:='字段1,字段2 desc';
ARecordSet.CursorLocation:=adUseClient;//缺省值,可不写
ARecordSet.open('pipevalue',AConnection,adOpenStatic,adLockOptimistic,adCmdTable );
ARecordSet.Sort:='字段1,字段2 desc';//用排序也一样