Serious OLEDB Bug in DELETE Statements ?
From: ajk-eis (anonymous_at_discussions.microsoft.com)
Date: 04/27/04
- Next message: Phil Da Lick!: "JET 4.0 Provider doesn't support IDBCreateSession?"
- Previous message: Val Mazur: "Re: VB 6 ADO vs Microsoft Query Analyzer"
- Next in thread: ajk-eis: "RE: Serious OLEDB Bug in DELETE Statements ?"
- Reply: ajk-eis: "RE: Serious OLEDB Bug in DELETE Statements ?"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 27 Apr 2004 02:21:04 -0700
Hi,
I've just spent a day trying to find a serious mistake in an OLEDB DELETE to an ACCESS Database.
In spite of a quite detailed WHERE clause, the delete query deleted all records in the underlying table.
SQL - "DELETE FROM MyTable WHERE Type = @Para1 AND Applications_ID = @Para2 AND Recipient = @Para3 "
Pretty detailed you would think and I expected ONE row to be deleted (because only one matched the WHERE clause). As said, ALL rows were deleted from the table. As usual, the mistake was a small one, the column name "Applications_ID" is in fact "Application_ID" and "Recipient" is actually "Recipients". (I should sleep more)
The application is in C# (DOTNET) and uses the native OLEDB Driver. This statement is part of a transaction.
I would have expected an OLEDB exception indicating that the column name was not found OR too few parameters (as ACCESS unfortunately often does treat unknown names as parameters). This was not the case AND THE TRANSACTION WAS COMPLETED WITHOUT ERRORS !! (meaning a commit was made!!) Bye, bye to all records which have Type equal to Para1 !!
Is this a known bug ?? I can't believe it.
Be glad for any comments or suggestions. The problem is solved but I'd hate to have a mistake like that with production data !!
- Next message: Phil Da Lick!: "JET 4.0 Provider doesn't support IDBCreateSession?"
- Previous message: Val Mazur: "Re: VB 6 ADO vs Microsoft Query Analyzer"
- Next in thread: ajk-eis: "RE: Serious OLEDB Bug in DELETE Statements ?"
- Reply: ajk-eis: "RE: Serious OLEDB Bug in DELETE Statements ?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|