Martin,
Does VC++ have an interface IComparer available ? I am not
at all experienced in C++, sorry, i couldn't help you.
Thanks,
Tap
>-----Original Message-----
>At this point, I just have a ADO::Recordset... (my code
is below... prety
>basic). I am just creating a rowset, and populating,
then outputting... it
>works.
>
>However, say I want to sort on the '0' field or the '1'
field, i..e. "F1" or
>"F2"... how do I create the view to do this? I.e.,.
where I have the printf
>statement below, I'd like to have it sort by the F2
column...
>Also... I will eventually need to 'JOIN' two such
recordsets together... is
>this going to be possible with a view?
>
>Thanks for your help!
>MS
>
>
> // TODO: Implement the command
> ADO::_RecordsetPtr oRset;
> oRset.CreateInstance(__uuidof(ADO::Recordset));
> oRset->PutCursorLocation(ADO::adUseClient);
> oRset->PutRefActiveConnection(NULL);
> oRset->PutRefSource(NULL);
> ADO::FieldsPtr pFlds = oRset->GetFields();
> pFlds->Append
(L"F1",ADO::adInteger,0,ADO::adFldUpdatable);
> pFlds->Append(L"F2",ADO::adBSTR ,0,ADO::adFldUpdatable);
>
>oRset->Open
(vtMissing,vtMissing,ADO::adOpenStatic,ADO::adLockBatchOpti
mistic
>,ADO::adCmdUnspecified);
>
>
>// autocad specific code to populate rowset
> AcDbDatabase *pCurDb;
> Acad::ErrorStatus es;
> AcDbLayerTable* pLT;
> AcDbLayerTableIterator *pLTI;
> AcDbLayerTableRecord* pLTR;
> AcCmColor color;
> char* name;
>
> pCurDb=acdbHostApplicationServices()->workingDatabase();
> es=pCurDb->getLayerTable(pLT,AcDb::kForRead);
>
> pLT->newIterator(pLTI);
>
> for(;!pLTI->done();pLTI->step())
> {
>
> pLTI->getRecord(pLTR,AcDb::kForRead);
> color=pLTR->color();
> es=pLTR->getName(name);
>
> oRset->AddNew(vtMissing,vtMissing);
> oRset->PutCollect((short)0,(long)color.colorIndex());
> oRset->PutCollect((short)1,(BSTR)name);
> oRset->Update();
>
> if(name)
> free(name);
>
> pLTR->close();
> }
>
>
> if(pLTI)
> delete pLTI;
> pLT->close();
>// end autocad specific code
>
>
> oRset->MoveFirst();
>
> for(int rowNum=0; !oRset->adoEOF;oRset->MoveNext
(),rowNum++)
> {
> int v1 = oRset->GetCollect((short)0).lVal;
> int v2 = oRset->GetCollect((short)1).lVal;
> //int v3 = oRset->GetCollect((short)2).lVal;
> acutPrintf("\nFrom row %3d: %5d %
s",rowNum,v1,v2/*,v2,v3*/);
> }
> oRset->Close();
> oRset.Release();
>
>
>--
>Thanks,
>Martin Schmid, EIT, CCSA, MCDBA, MCSE
>"Tap" <(E-Mail Removed)> wrote in message
>news:002f01c36b30$b1c86b50$(E-Mail Removed)...
>> Martin,
>>
>> Create a view from your dataset and then you can sort it
>> on any column.
>>
>> Thanks,
>>
>> Tap
>>
>> >-----Original Message-----
>> >Am trying to model some data, and it is not comming
from
>> a datasource that I
>> >can connect to... I have to read the data, and create
my
>> rowset... When I
>> >have this table of data, is it possible to query this
>> data.. i.e. to sort
>> >(ORDER BY) a specific column, or do I need a connection
>> to do that? I want
>> >to avoid having to connect to a data source to dump in
my
>> data just to be
>> >able to sort on it...
>> >
>> >Any help is more than welcome..
>> >
>> >--
>> >Thanks,
>> >Martin Schmid, EIT, CCSA, MCDBA, MCSE
>> >
>> >
>> >.
>> >
>
>
>.
>