Strange Problem: Why field can't be Modified with TADODataset
From: Edward Wang (edwardwang_at_qt-asia.com)
Date: 06/24/04
- Next message: Lutz Kutscher: "Using SQLMonitor with ADO"
- Previous message: Brian Bushay TeamB: "Re: DisableControls does'nt disable controls"
- Next in thread: Edward Wang: "Could anyone plz kindly help me? :("
- Reply: Edward Wang: "Could anyone plz kindly help me? :("
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 24 Jun 2004 14:03:34 +0800
Hello all,
I am using a TADODataset to open a statement from SQL Server 2000, and
encounterd a strange problem:
sSQL: SELECT CLIENT_NAME, AGE, SPACE(50) AS CLIENT_ADDRESS FROM [CLIENT];
tmpADODataSet := TADODataSet.Create(Application);
tmpADODataSet.Connection := GetConnection;
tmpADODataSet.LockType := ltBatchOptimistic;
tmpADODataSet.CommandText := sSQL;
tmpADODataSet.Open;
Ok, when I try to change the records like following:
tmpADODataSet.FieldByName('CLIENT_NAME').AsString = 'New Name';
This should be ok, but:
tmpADODataSet.FieldByName('CLIENT_ADDRESS').AsString = 'Address';
This should report an error.
What's the matter? I can do it sucussfully with BDE, but failed in ADO.
Thanks a lot.
Edward
- Next message: Lutz Kutscher: "Using SQLMonitor with ADO"
- Previous message: Brian Bushay TeamB: "Re: DisableControls does'nt disable controls"
- Next in thread: Edward Wang: "Could anyone plz kindly help me? :("
- Reply: Edward Wang: "Could anyone plz kindly help me? :("
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|