Paul Clement
4/7/2005 2:12:00 PM
On Thu, 7 Apr 2005 02:01:04 -0700, "MS Access 2003 delete problem" <MS Access 2003 delete
problem@discussions.microsoft.com> wrote:
¤ Hi,
¤
¤ My program in C# got executed fine with MSAccess 2000 as its backend. I was
¤ able to delete the data and insert new data in my table. But after upgrading
¤ the Access to MS Access 2003, I''m able to access the data (Do a select from
¤ the table) but i''m not able to delete the data from the table. It throws an
¤ error,
¤
¤ "An unhandled exception of type ''System.Data.OleDb.OleDbException'' occurred
¤ in system.data.dll".
¤
¤ Please help me out to solve this issue. Below is my code,
¤
¤ string delete = "DELETE * FROM [Resource Details]" ;
¤ // Opening a DB connection
¤ OleDbConnection ExcConnection = new OleDbConnection(
¤ @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\Tool\Resource Details.mdb
¤ User Id=admin;Password=;" );
¤
¤ OleDbCommand ExcCommand = new OleDbCommand( @"SELECT * FROM [Resource
¤ Details]", ExcConnection );
¤
¤ // Commandset to delete the table
¤ OleDbCommand deleteCommand = new OleDbCommand(delete,ExcConnection);
¤
¤ ExcConnection.Open();
¤ deleteCommand.ExecuteNonQuery();
¤ ExcConnection.Close();
¤
¤
¤ Error occurs at : deleteCommand.ExecuteNonQuery();
Do you have any more information on the error? There is typically error information that is a bit
more specific than what you posted.
Paul
~~~~
Microsoft MVP (Visual Basic)