?
Solved

Serious failure on OleDbConnection

Posted on 2005-03-24
5
Medium Priority
?
234 Views
Last Modified: 2010-04-16
I am having a serious failure using Access, with OldDbConnection.  I have two program (both WinForms) which read and write to the same table.  I am very careful to enclose all related code for both program in a try catch, and watch the Exceptions table like a hawk.  But every so often it seems like a record disappears, and this problem effects any record.  So I'm wondering if I'm overlooking something in the way I've designed this handshake.

One program produces the records by performing a write.  The other program reads the record and deletes it to show the record's been consumed.

I log the preceding steps leading up to this problem, and see that both programs seem to be acting correctly.  In other words, I see that the program producing the record actully produced it.  And while other orders arrive into the log of the receiving program, sometime a single record (or sometimes two) simply never showed up on the other end.

I also found that I can compress and repair the Access table upon exit, and am now confident that file corruption is not the problem.

Does anyone have any idea about what could cause a record to disappear when no apparent exceptions are thrown?  I'm really at a loss, especially since this is a show stopper for the whole project.

Thanks for the help.

Bob
0
Comment
Question by:ba272
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 

Author Comment

by:ba272
ID: 13622726
Also...

I call the function which reads the table, for the receiving program, and pass in a delegate as a parameter.  Could this be a problem?

I designed a standard read function, and empower the function to read data from a host of table formats by call the delegate function which was passed in as a parameter.
0
 
LVL 8

Expert Comment

by:rajaloysious
ID: 13624762
just a thought.

While deleting are you deleting the read records one by one or as a group?

if insert records are dummped into a file along with the timestamp
and read records to be deleted are dumped into another file with the timestamp along with the delete statement
 may give you a clue.

There is no way records will vanish from a database table unless you delete them


cheers
0
 

Author Comment

by:ba272
ID: 13624842
Thanks for the input.

I delete them at the end, as a group: DELETE * FROM tablename

I'm right now comenting out everything else in my program, except the order handshake.  I'll  boil it down to that, and hopefuly be able to get it working.  Then I'll carefully add the other code back in, testing all the while.

Yes, I have done some work with a backup table, but I think it's worth me copying the to-be-deleted records to a backup table.

Thanks.
0
 
LVL 8

Accepted Solution

by:
rajaloysious earned 2000 total points
ID: 13624876
You should be deleting records one by one as you read.
delete * from tablename where primarykey1=value and primarykey2=value2

If there is a concept called rowid, it can also be used, but i think it isnt there Access

cheers
0
 

Author Comment

by:ba272
ID: 13624908
Would that mean I need to execute another query to delete each record?

DELETE * FROM tablename WHERE ID='32' ?  (for example)

Is there a possibility that I'm deleting new orders with the mre general

DELETE * command?

WOw.

I think you're right.  New orders which have arrived afterthe first query was made will also be deleted.

Dude, you're my hero.

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question