Transaction complete

Graogramar
07-18-2003, 03:10 AM
Hi Folks.

I work with a Access Database, which is stored on a server, and several VB-Clients.
In the code i used the combination of BeginTrans and CommitTrans. In some cases, ADO seems to be faster than Access, so the Code after the
CommitTrans method runs, before the CommitTrans is complete. I'm now using a long variable, which counts ub to 20,000,000. This is not the way i like. Is there another "elegant" way to solve that problem.

Thanks.

Anis
07-18-2003, 03:23 AM
Can you some of your code, how you are using it.

thorin92
07-18-2003, 06:23 AM
Instead of using a counting loop, use a timer that is enabled when the transaction starts, you can then set the timeout in mS to wait for the transaction to complete.

Graogramar
07-18-2003, 06:31 AM
Can you some of your code, how you are using it.
Here is a fragment of my Code:
(the fields in the DataReport are not right. Not al Data is on the report, but in the database and also in the recordsets)

SQL = "...

globalCon.BeginTrans
globalCon.Execute (SQL)
globalCon.CommitTrans


i = 0 //this should be "elegant"
While (i < 20000000)
i = i + 1
Wend


On Error Resume Next
DataEnvironment1.rsStatus.Open
On Error GoTo 0
DataEnvironment1.rsStatus.Requery
Set drReport = New DataReport
drReport.Sections.Item("ReportHeader").Controls.Item("LabelÜberschrift").Caption = strReportUeberschrift
drReport.Sections.Item("ReportFooter").Controls.Item("LabelGesamtsumme").Caption = "Gesamtsumme: " & rsSt!Gesamt
drReport.Show

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum