If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Access97 DB Corruption using ADO 2.0

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-01-03, 03:01
chris_50 chris_50 is offline
Registered User
 
Join Date: Mar 2003
Posts: 1
Access97 DB Corruption using ADO 2.0

Hello,
I'm new to this board.
I have a problem and was wondering if someone could help me.

The system that I work on has following components:
Two Access97 databases, DB1 and DB2 reside on network share Z:
I developed a front end (FE) in VB6 that uses ADO 2.0 internally to connect to these two databases using Jet 3.51 provider. The FE is distributed to 20 workstations and when it starts up, 2 connection objects (cnDB1, cnDB2 global in scope) are created and remain open throughout the whole time the FE is opened.
The system has been up and running for about 2 years now, but recently in the last 2 months one of the databases gets corrupted quite often (seems like every few days).
I suspect that the corruption happens during the write process on one of the users workstations.
I have a piece of code that uses transactions on both connection objects at the same time, since business logic requires creating an invoice in DB1 and log it in DB2.

Public Sub CreateInvoice()
On Error GoTo ErrHandler

cnDB1.BeginTrans
cnDB2.BeginTrans

'Code that creates invoice in DB1
.
.
'Code that logs the invoice creation in DB2
.
.

cnDB2.CommitTrans
cnDB1.CommitTrans

Exit Sub

ErrHandler:
cnDB2.RollbackTrans
cnDB1.RollbackTrans

MsbBox Err.Description
End Sub



Is this a legal nesting of connection object transactions?
And could it be the reason for database corruption?

By the way, only DB1 gets corrupted.

Thank you for any help,
Chris.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On