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 > ASP > Need to disable AUTOCOMMIT in ASP page

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-10-04, 17:42
mrichards mrichards is offline
Registered User
 
Join Date: Dec 2004
Posts: 4
Question Need to disable AUTOCOMMIT in ASP page

I have an application that is ASP based and connects to a IBM DB2 v7.2 database. I'm using the IBM DB2 ODBC driver and IIS 5.0 Does anyone know how to disable the AUTOCOMMIT? Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 12-19-04, 20:32
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
What is doing the committing? The ODBC driver or the asp code??? Perhaps you could post your code and explain a bit more?
Reply With Quote
  #3 (permalink)  
Old 12-21-04, 12:29
mrichards mrichards is offline
Registered User
 
Join Date: Dec 2004
Posts: 4
My understanding is that by default, ODBC calls thru the IBM DB2 ODBC driver are in autocommit mode. I need to make sure that the autocommit is disabled for this application. I thought there was a way to do it via the connection String? I need to make sure the commits or rollbacks are handled manually.

Some code excerpts are below:

--This code is called from an include file:
gstrConnectionString = ("DSN=HR; OLE DB Services=-4; DBALIAS=HR;UID="& Session("dbUser") &"; PWD="& Session("dbPasswd") &";")
Set connDB = Server.CreateObject("ADODB.Connection")
connDB.ConnectionString = gstrConnectionString
-- End of include file


Set connRS1 = Server.CreateObject("ADODB.RecordSet")
'
connDB.Open
connDB.BeginTrans


if (Request.Form("TransName") = "AddGeneratedAppraisal") then

strSQLUsed = insertGeneratedAppraisal(Request.Form("reviewerEmp no"), Request.Form("Empno"), Request.Form("review_Start_Date"),_
Request.Form("review_End_Date"), Request.Form("daysTardy"), Request.Form("daysAbsent"),_
Request.Form("safetyRecord"))

connRS1.Open strSQLUsed,connDB
DBErrorCount = DBErrorCapture(connDB, "insertGeneratedAppraisal", strSQLUsed)

'connRS1.close


if (DBErrorCount > 0) then
connDB.RollbackTrans
TransactionAbort
else
connDB.CommitTrans
TransactionCommit
end if
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On