Re: Can't Delete Records from an MS Access DB
- From: Larry Dew <ldew@xxxxxxxxxx>
- Date: Thu, 18 May 2006 16:25:58 -0500
Brian Bushay TeamB wrote:
Thanks for the help. The Help file indicates that the default value for DeleteRecords is arAll. I tried arFiltered and received the same message. What is the "Context" referring too?AllocationID is an Indexed (dup=YES) field.
Tbl := TADOTable.Create( Self );
try
with Tbl do // return all records with the AllocationID
begin
Connection := DM.Allocations;
TableName := 'Allocated';
Filter := format( 'AllocationID = %d',[AllocationId]);
Filtered := TRUE;
Open;
if (RecordCount > 0) and Supports( [coDelete] ) then
DeleteRecords(arAll);
end;
finally
Tbl.Free;
end; { try/finally }
The ArAll option doesn't work with DeleteRecords.
To do this with SQL user a query like this
AdoQuery1.SQL.clear;
AdoQuery1.sql.add('Delete from Allocated where AllocationID =
'+quotedStr(AllocationId) )
--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.
- Follow-Ups:
- Re: Can't Delete Records from an MS Access DB
- From: Brian Bushay TeamB
- Re: Can't Delete Records from an MS Access DB
- References:
- Can't Delete Records from an MS Access DB
- From: Larry Dew
- Re: Can't Delete Records from an MS Access DB
- From: Brian Bushay TeamB
- Can't Delete Records from an MS Access DB
- Prev by Date: Exceptions not treated properly with SQL Server Express 2005 database
- Next by Date: File system indexing - SQL
- Previous by thread: Re: Can't Delete Records from an MS Access DB
- Next by thread: Re: Can't Delete Records from an MS Access DB
- Index(es):
Relevant Pages
|