| View previous topic :: View next topic |
| Author |
Message |
Peter Tickler Guest
|
Posted: Tue Jul 12, 2005 1:54 pm Post subject: Deleting records from TADOTable |
|
|
I am trying to delete all records from a TADOTable. I am using the following line of code:
tblInvoices.DeleteRecords(arAll);
But it gives an error message: "Operation is not allowed in this context".
Any idea what might be causing this?
|
|
| Back to top |
|
 |
Charles Collins Guest
|
Posted: Tue Jul 12, 2005 3:11 pm Post subject: Re: Deleting records from TADOTable |
|
|
DeleteRecords does not work. Use a Command component. See my message from
7/1 about the same problem, message subject "Operation is not allowed in
this context".
"Peter Tickler" <ptickler (AT) potato (DOT) org.uk> wrote
| Quote: |
I am trying to delete all records from a TADOTable. I am using the
following line of code:
tblInvoices.DeleteRecords(arAll);
But it gives an error message: "Operation is not allowed in this context".
Any idea what might be causing this?
Add a component like: MyCmd: TADOCommand; |
Instead of using the DeleteRecords, use a routine like this:
CabInfo.Active := true;
MyCmd.CommandText := 'Delete * from CabInfo';
MyCmd.Execute;
CabInfo.Active := false;
where CabInfo is your table name.
|
|
| Back to top |
|
 |
Peter Tickler Guest
|
Posted: Thu Jul 14, 2005 9:12 am Post subject: Re: Deleting records from TADOTable |
|
|
Brian Bushay TeamB <BBushay (AT) Nmpls (DOT) com> wrote:
| Quote: | Unfortunately Microsoft never implemented that option for DeleteRecords.
You will need to use a Delete query.
--
Brian Bushay (TeamB)
[email]Bbushay (AT) NMPLS (DOT) com[/email]
|
Thanks. I have done it as you suggest.
Peter
|
|
| Back to top |
|
 |
|