Re: Can't Delete Records from an MS Access DB
- From: Brian Bushay TeamB <BBushay@xxxxxxxxx>
- Date: Wed, 17 May 2006 21:43:35 -0500
AllocationID is an Indexed (dup=YES) field.The ArAll option doesn't work with DeleteRecords.
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 }
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: Larry Dew
- Re: Can't Delete Records from an MS Access DB
- References:
- Can't Delete Records from an MS Access DB
- From: Larry Dew
- Can't Delete Records from an MS Access DB
- Prev by Date: Cannot open Access table with ADO or BDE/ODBC
- Next by Date: Re: connect to excel
- Previous by thread: 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
|