problem with TClientDataSet working with ADO

From: bin (bin_at_acclaimgroup.co.nz)
Date: 09/22/04

  • Next message: George Kvasha: "IndexFieldnames Sort"
    Date: Wed, 22 Sep 2004 12:37:44 +1200
    
    

    Hi.
    -----------------------------------------------------------------
    I met a problem, hope someone can help me.

    TADOQuery=>TDataSetProvider=>TClientDataSet

    (1). TADOQuery.SQL.Text:='select count(accno) as accno from dr_accs'
    (2). TADOQuery.SQL.Text:='select accno from dr_accs'

    when I use follow statements, It will pop an error-'Trying to modify
    read-only field' with the number (1) ADOQuery statment,
    however, when I use number (2) ADOQuery statement for testing, it can work.

    TClientDataSet.Open;
    TClientDataSet.Edit;
    TClientDataSet.FieldByName('accno').ReadOnly:=False;
    TClientDataSet.FieldByName('accno').AsInteger:=100;
    TClientDataSet.Post;
    TClientDataSet.Close;

    I also tested DBX with the same situation, but it seems it can work for
    both.
    Can anyone help me to let the number(1) ADOQuery statement can work for ADO?

    Thanks a lot!

                                                                                 
                                           Bin.


  • Next message: George Kvasha: "IndexFieldnames Sort"