Unable to Insert or Delete records

G

Guest

System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAM¬S
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.
Here is a little background on my program that may help in resolving
the issue.
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. So at this point I know
that the user who is running the application has the sufficient access
to write and modify files in the folder which my application writes
out this new file. Next my program connects to the database and makes
a select call on one of the tables that is in the database. In the
case of the user who is experiencing problems with my app the select
call works. So at this point I am pretty sure that my application is
able to write out a the mdb file, connect to the mdb file, and perform
an SQL query on the file. Now when the program tries to perform any
Insert or Delete queries in my application it fails and I get the
error above.
I can not reproduce the error at all, which makes me believe that it
is not any type of syntax error. I also 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(tagDBPARAM¬S
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)
 
S

Stefan Hoffmann

hi Tommy,
Now when the program tries to perform any
Insert or Delete queries in my application it fails and I get the
error above.
What error message? Can you provide a stack trace?

mfg
--> stefan <--
 
G

Guest

It may be hard to read, but the only stack trace information I get back is in
the log part provided above.

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')

I provided my log file info because I use a code obfuscator in production,
so the track trace information is hard to read. Like here the exception
occurred in my FlashcardManager.PerformAction function, but the stack trace
shows FlashcardManager .xdc76805d00b2a72d.xd170ced8774bc454. I hope this
helps.
 
S

Stefan Hoffmann

hi Tommy,
I provided my log file info because I use a code obfuscator in production,
so the track trace information is hard to read. Like here the exception
occurred in my FlashcardManager.PerformAction function, but the stack trace
shows FlashcardManager .xdc76805d00b2a72d.xd170ced8774bc454. I hope this
helps.
Is there also an inner exception?

Can you test such a failing embedded .mdb? Do you compact it, before
embedding?


mfG
--> stefan <--

btw, this kind of "security" is more than obscure. Is there really a
need for it?
 
G

Guest

Is there also an inner exception?
Well kind of fortunate and unfortunate at the same time. I asked my user to
both reinstall the .Net Framework and my version that captured more debug
information. Everything is working now. I think the reinstall of the
Framework did the trick to fix the issue. The unfortunate thing is that I
never got the chance to see the inner exception log.


btw, this kind of "security" is more than obscure. Is there really a
need for it?
I know that there is really no way to stop people hacking applications, but
I felt that I should at least do a little effort at detouring someone from
trying. This way if I ever caught someone I can say that I did try to stop
someone from doing it. It is soo easy to decompile .Net code, and see
everything in the code. I don’t want someone just to decompiling my code and
rewrite my licensing functions and recompile the code. That is my thinking
when I bought a code obfuscator. http://www.xenocode

Thanks for your help
 

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