Unable to Insert or Delete records

K

Kohler

System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)

I have an application that is in production and being used by many
people. I received a support email a couple of days ago, and I have
been racking my brain over what may be causing the issue. It seems
that the error I am getting is a pretty common error that applies for
almost anything. I am looking for any guidance on what may be causing
this error. I get this error on all my inserts and deletes. All the
selects work fine. This led me to believe that this may be some type
of permissions error. Though, the mdb file that the application is
accessing is not read only and does not have any user access setup for
the mdb file. I can not reproduce the error at all. I have never
seen this type of behavior on any computer that my software has ever
been installed on. Does anyone know what the problem may be, or have
any suggestions on how I could go about trying to find out?

Here is a copy of my DB function.

Friend Sub PerformAction(ByVal SQLCommand As String, ByVal
CommandObject As OleDbCommand)
Call m_logger.Debug("Begin PerformAction(ByVal SQLCommand As
String, ByVal CommandObject As OleDbCommand)")
Try
CommandObject.CommandText = SQLCommand
Call m_logger.Debug(SQLCommand)
CommandObject.ExecuteNonQuery()
Catch ex As Exception
m_logger.Fatal("ex.Message = " + ex.Message +
"ex.StackTrace = " + ex.StackTrace + " SQLCommand = " + SQLCommand)
End Try

Call m_logger.Debug("End PerformAction(ByVal SQLCommand As
String, ByVal CommandObject As OleDbCommand)")
End Sub


This is what gets put out to my log.

2007-02-28 06:55:09,000 [3364] (144622) DEBUG fcmFlashcardManager -
Begin PerformAction(ByVal SQLCommand As String, ByVal DbConnection As
OleDbConnection)
2007-02-28 06:55:09,000 [3364] (144622) DEBUG fcmFlashcardManager -
Insert into [KeyPlacement]([FlashcardID], [NextFlashcardID]) VALUES
('START','2dd746b3-b80e-4ff8-9cc3-1e72141ecc97')
2007-02-28 06:55:09,016 [3364] (144637) FATAL fcmFlashcardManager -
ex.Message = Unknownex.StackTrace = at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at FlashcardManager.xdc76805d00b2a72d.xd170ced8774bc454(String
x24d48be70b20c549, OleDbConnection x5120ced92b5061d3) SQLCommand =
Insert into [KeyPlacement]([FlashcardID], [NextFlashcardID]) VALUES
('START','2dd746b3-b80e-4ff8-9cc3-1e72141ecc97')
2007-02-28 06:55:09,016 [3364] (144637) DEBUG fcmFlashcardManager -
End PerformAction(ByVal SQLCommand As String, ByVal DbConnection As
OleDbConnection)
 
B

Brendan Reynolds

One possibility - and a fairly strong one, I think - is that the identity
under which the code is executing does not have sufficient permission on the
MDB or, just as importantly, on the folder in which the MDB is stored.

I've been away from .NET stuff for a bit recently, so I won't attempt to
comment on the specifics, as I'd likely get it wrong. You might want to try
asking the question in an ADO.NET forum.

--
Brendan Reynolds
Access MVP

Kohler said:
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)

I have an application that is in production and being used by many
people. I received a support email a couple of days ago, and I have
been racking my brain over what may be causing the issue. It seems
that the error I am getting is a pretty common error that applies for
almost anything. I am looking for any guidance on what may be causing
this error. I get this error on all my inserts and deletes. All the
selects work fine. This led me to believe that this may be some type
of permissions error. Though, the mdb file that the application is
accessing is not read only and does not have any user access setup for
the mdb file. I can not reproduce the error at all. I have never
seen this type of behavior on any computer that my software has ever
been installed on. Does anyone know what the problem may be, or have
any suggestions on how I could go about trying to find out?

Here is a copy of my DB function.

Friend Sub PerformAction(ByVal SQLCommand As String, ByVal
CommandObject As OleDbCommand)
Call m_logger.Debug("Begin PerformAction(ByVal SQLCommand As
String, ByVal CommandObject As OleDbCommand)")
Try
CommandObject.CommandText = SQLCommand
Call m_logger.Debug(SQLCommand)
CommandObject.ExecuteNonQuery()
Catch ex As Exception
m_logger.Fatal("ex.Message = " + ex.Message +
"ex.StackTrace = " + ex.StackTrace + " SQLCommand = " + SQLCommand)
End Try

Call m_logger.Debug("End PerformAction(ByVal SQLCommand As
String, ByVal CommandObject As OleDbCommand)")
End Sub


This is what gets put out to my log.

2007-02-28 06:55:09,000 [3364] (144622) DEBUG fcmFlashcardManager -
Begin PerformAction(ByVal SQLCommand As String, ByVal DbConnection As
OleDbConnection)
2007-02-28 06:55:09,000 [3364] (144622) DEBUG fcmFlashcardManager -
Insert into [KeyPlacement]([FlashcardID], [NextFlashcardID]) VALUES
('START','2dd746b3-b80e-4ff8-9cc3-1e72141ecc97')
2007-02-28 06:55:09,016 [3364] (144637) FATAL fcmFlashcardManager -
ex.Message = Unknownex.StackTrace = at
System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS
dbParams, Object& executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object&
executeResult)
at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior
behavior, Object& executeResult)
at
System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior
behavior, String method)
at System.Data.OleDb.OleDbCommand.ExecuteNonQuery()
at FlashcardManager.xdc76805d00b2a72d.xd170ced8774bc454(String
x24d48be70b20c549, OleDbConnection x5120ced92b5061d3) SQLCommand =
Insert into [KeyPlacement]([FlashcardID], [NextFlashcardID]) VALUES
('START','2dd746b3-b80e-4ff8-9cc3-1e72141ecc97')
2007-02-28 06:55:09,016 [3364] (144637) DEBUG fcmFlashcardManager -
End PerformAction(ByVal SQLCommand As String, ByVal DbConnection As
OleDbConnection)
 
K

Kohler

My program has an embedded mdb file as a resource. When the user
starts up my app it extracts that embedded resource and creates an
“untitled#.mdb†file in the last use folder. I have had a problem
when a limited user uses my program and doesn’t have access to write a
file to that folder. I am working on a fix for that as wellïŠ. Butin
this case my program was able to write the file out and perform some
select calls on the newly created file. The problem seems to come
when it tries to modify the file. Does this make since? Is there a
way to have a user’s permissions to not be able to do any type of
modification to any access databases? Or is there a way to set up
different privileges in an access database. I want there to be no
limit on who can change the file. As far as I know this is the first
case where when someone tried to run my computer it did work.
 
B

Brendan Reynolds

Yes it is possible using JET user-level security to limit the permissions
that users have on the database or on objects within the database, but it
doesn't happen by default. I think it is more likely that the identity under
which the code is running does not have sufficient permission on the folder
to create the .LDB record-locking file. The identity under which the code
runs needs read and write permission on the folder to create and modify the
..LDB file, and delete permission to delete the .LDB file when the connection
to the .MDB is closed. As I said earlier, I'm a bit rusty on .NET stuff at
the moment, so I recommend asking the question in an ADO.NET forum. You can
probably get more specific help there.

--
Brendan Reynolds
Access MVP

My program has an embedded mdb file as a resource. When the user
starts up my app it extracts that embedded resource and creates an
"untitled#.mdb" file in the last use folder. I have had a problem
when a limited user uses my program and doesn't have access to write a
file to that folder. I am working on a fix for that as well?. But in
this case my program was able to write the file out and perform some
select calls on the newly created file. The problem seems to come
when it tries to modify the file. Does this make since? Is there a
way to have a user's permissions to not be able to do any type of
modification to any access databases? Or is there a way to set up
different privileges in an access database. I want there to be no
limit on who can change the file. As far as I know this is the first
case where when someone tried to run my computer it did work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top