Board index » delphi » Cannot compare "Sort" with a string

Cannot compare "Sort" with a string

Hello,

 I cannot read the Sort order!

  First I assign a sort order to the DataSet
  AdoDataSet.Sort := 'ITEM_NO ASC';

 After I try to compare the value.
 All the following statements return False
  AdoDataSet.Sort = AdoDataSet.Sort;
  AdoDataSet.Sort = 'ITEM_NO ASC';

The field ITEM_NO is not indexed. The table has a primary index on 2
fields

Thank you for your time
Serge myrand

 

Re:Cannot compare "Sort" with a string


Quote
>   AdoDataSet.Sort := 'ITEM_NO ASC';

This is only allowed with client side cursors. Is this the case?

--
V. Nazarov
IT Manager, Sofia Cable

Quote
Serge Myrand <i...@softdelirium.qc.ca> wrote in message

news:38E4E98C.ACE04C21@softdelirium.qc.ca...
Quote
> Hello,

>  I cannot read the Sort order!

>   First I assign a sort order to the DataSet
>   AdoDataSet.Sort := 'ITEM_NO ASC';

>  After I try to compare the value.
>  All the following statements return False
>   AdoDataSet.Sort = AdoDataSet.Sort;
>   AdoDataSet.Sort = 'ITEM_NO ASC';

> The field ITEM_NO is not indexed. The table has a primary index on 2
> fields

> Thank you for your time
> Serge myrand

Re:Cannot compare "Sort" with a string


Yes, it is a ClientCursor

Serge Myrand

Quote
Vassil Nazarov wrote:
> >   AdoDataSet.Sort := 'ITEM_NO ASC';

> This is only allowed with client side cursors. Is this the case?

> --
> V. Nazarov
> IT Manager, Sofia Cable

> Serge Myrand <i...@softdelirium.qc.ca> wrote in message
> news:38E4E98C.ACE04C21@softdelirium.qc.ca...
> > Hello,

> >  I cannot read the Sort order!

> >   First I assign a sort order to the DataSet
> >   AdoDataSet.Sort := 'ITEM_NO ASC';

> >  After I try to compare the value.
> >  All the following statements return False
> >   AdoDataSet.Sort = AdoDataSet.Sort;
> >   AdoDataSet.Sort = 'ITEM_NO ASC';

> > The field ITEM_NO is not indexed. The table has a primary index on 2
> > fields

> > Thank you for your time
> > Serge myrand

Re:Cannot compare "Sort" with a string


I use the following construct allot with DBGrids and it works fine for me.
Everything looks right with your code too, so I don't have a clue.
Sorry.

procedure TForm.DBGridTitleButtonClick(Sender: TObject; AFieldName: String);
begin
  If DataModule.ADODataSet.Sort = AFieldName Then
    DataModule.ADODataSet.Sort := AFieldName+' DESC'
  ELSE
    DataModule.ADODataSet.Sort:=AFieldName;
end;

--
V. Nazarov
IT Manager, Sofia Cable

Quote
Serge Myrand <i...@softdelirium.qc.ca> wrote in message

news:38E60275.A7BD0BF4@softdelirium.qc.ca...
Quote

> Yes, it is a ClientCursor

> Serge Myrand

> Vassil Nazarov wrote:

> > >   AdoDataSet.Sort := 'ITEM_NO ASC';

> > This is only allowed with client side cursors. Is this the case?

> > --
> > V. Nazarov
> > IT Manager, Sofia Cable

> > Serge Myrand <i...@softdelirium.qc.ca> wrote in message
> > news:38E4E98C.ACE04C21@softdelirium.qc.ca...
> > > Hello,

> > >  I cannot read the Sort order!

> > >   First I assign a sort order to the DataSet
> > >   AdoDataSet.Sort := 'ITEM_NO ASC';

> > >  After I try to compare the value.
> > >  All the following statements return False
> > >   AdoDataSet.Sort = AdoDataSet.Sort;
> > >   AdoDataSet.Sort = 'ITEM_NO ASC';

> > > The field ITEM_NO is not indexed. The table has a primary index on 2
> > > fields

> > > Thank you for your time
> > > Serge myrand

Re:Cannot compare "Sort" with a string


Hi,

Which ADO Patch do you have installed. I have the latest (the one's after the
official one's!)

Serge Myrand

Quote
Vassil Nazarov wrote:
> I use the following construct allot with DBGrids and it works fine for me.
> Everything looks right with your code too, so I don't have a clue.
> Sorry.

> procedure TForm.DBGridTitleButtonClick(Sender: TObject; AFieldName: String);
> begin
>   If DataModule.ADODataSet.Sort = AFieldName Then
>     DataModule.ADODataSet.Sort := AFieldName+' DESC'
>   ELSE
>     DataModule.ADODataSet.Sort:=AFieldName;
> end;

> --
> V. Nazarov
> IT Manager, Sofia Cable

> Serge Myrand <i...@softdelirium.qc.ca> wrote in message
> news:38E60275.A7BD0BF4@softdelirium.qc.ca...

> > Yes, it is a ClientCursor

> > Serge Myrand

> > Vassil Nazarov wrote:

> > > >   AdoDataSet.Sort := 'ITEM_NO ASC';

> > > This is only allowed with client side cursors. Is this the case?

> > > --
> > > V. Nazarov
> > > IT Manager, Sofia Cable

> > > Serge Myrand <i...@softdelirium.qc.ca> wrote in message
> > > news:38E4E98C.ACE04C21@softdelirium.qc.ca...
> > > > Hello,

> > > >  I cannot read the Sort order!

> > > >   First I assign a sort order to the DataSet
> > > >   AdoDataSet.Sort := 'ITEM_NO ASC';

> > > >  After I try to compare the value.
> > > >  All the following statements return False
> > > >   AdoDataSet.Sort = AdoDataSet.Sort;
> > > >   AdoDataSet.Sort = 'ITEM_NO ASC';

> > > > The field ITEM_NO is not indexed. The table has a primary index on 2
> > > > fields

> > > > Thank you for your time
> > > > Serge myrand

Re:Cannot compare "Sort" with a string


Me too.

--
V. Nazarov
IT Manager, Sofia Cable

Quote
Serge Myrand <i...@softdelirium.qc.ca> wrote in message

news:38E78404.1C4066ED@softdelirium.qc.ca...
Quote
> Hi,

> Which ADO Patch do you have installed. I have the latest (the one's after the
> official one's!)

> Serge Myrand

> Vassil Nazarov wrote:

> > I use the following construct allot with DBGrids and it works fine for me.
> > Everything looks right with your code too, so I don't have a clue.
> > Sorry.

> > procedure TForm.DBGridTitleButtonClick(Sender: TObject; AFieldName: String);
> > begin
> >   If DataModule.ADODataSet.Sort = AFieldName Then
> >     DataModule.ADODataSet.Sort := AFieldName+' DESC'
> >   ELSE
> >     DataModule.ADODataSet.Sort:=AFieldName;
> > end;

> > --
> > V. Nazarov
> > IT Manager, Sofia Cable

> > Serge Myrand <i...@softdelirium.qc.ca> wrote in message
> > news:38E60275.A7BD0BF4@softdelirium.qc.ca...

> > > Yes, it is a ClientCursor

> > > Serge Myrand

> > > Vassil Nazarov wrote:

> > > > >   AdoDataSet.Sort := 'ITEM_NO ASC';

> > > > This is only allowed with client side cursors. Is this the case?

> > > > --
> > > > V. Nazarov
> > > > IT Manager, Sofia Cable

> > > > Serge Myrand <i...@softdelirium.qc.ca> wrote in message
> > > > news:38E4E98C.ACE04C21@softdelirium.qc.ca...
> > > > > Hello,

> > > > >  I cannot read the Sort order!

> > > > >   First I assign a sort order to the DataSet
> > > > >   AdoDataSet.Sort := 'ITEM_NO ASC';

> > > > >  After I try to compare the value.
> > > > >  All the following statements return False
> > > > >   AdoDataSet.Sort = AdoDataSet.Sort;
> > > > >   AdoDataSet.Sort = 'ITEM_NO ASC';

> > > > > The field ITEM_NO is not indexed. The table has a primary index on 2
> > > > > fields

> > > > > Thank you for your time
> > > > > Serge myrand

Re:Cannot compare "Sort" with a string


where can i get the patch?

Quote
Serge Myrand <i...@softdelirium.qc.ca> wrote in message

news:38E78404.1C4066ED@softdelirium.qc.ca...
Quote
> Hi,

> Which ADO Patch do you have installed. I have the latest (the one's after
the
> official one's!)

> Serge Myrand

> Vassil Nazarov wrote:

> > I use the following construct allot with DBGrids and it works fine for
me.
> > Everything looks right with your code too, so I don't have a clue.
> > Sorry.

> > procedure TForm.DBGridTitleButtonClick(Sender: TObject; AFieldName:
String);
> > begin
> >   If DataModule.ADODataSet.Sort = AFieldName Then
> >     DataModule.ADODataSet.Sort := AFieldName+' DESC'
> >   ELSE
> >     DataModule.ADODataSet.Sort:=AFieldName;
> > end;

> > --
> > V. Nazarov
> > IT Manager, Sofia Cable

> > Serge Myrand <i...@softdelirium.qc.ca> wrote in message
> > news:38E60275.A7BD0BF4@softdelirium.qc.ca...

> > > Yes, it is a ClientCursor

> > > Serge Myrand

> > > Vassil Nazarov wrote:

> > > > >   AdoDataSet.Sort := 'ITEM_NO ASC';

> > > > This is only allowed with client side cursors. Is this the case?

> > > > --
> > > > V. Nazarov
> > > > IT Manager, Sofia Cable

> > > > Serge Myrand <i...@softdelirium.qc.ca> wrote in message
> > > > news:38E4E98C.ACE04C21@softdelirium.qc.ca...
> > > > > Hello,

> > > > >  I cannot read the Sort order!

> > > > >   First I assign a sort order to the DataSet
> > > > >   AdoDataSet.Sort := 'ITEM_NO ASC';

> > > > >  After I try to compare the value.
> > > > >  All the following statements return False
> > > > >   AdoDataSet.Sort = AdoDataSet.Sort;
> > > > >   AdoDataSet.Sort = 'ITEM_NO ASC';

> > > > > The field ITEM_NO is not indexed. The table has a primary index on
2
> > > > > fields

> > > > > Thank you for your time
> > > > > Serge myrand

Other Threads