Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2004
    Posts
    4

    Question Unanswered: 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.

  2. #2
    Join Date
    Nov 2003
    Location
    Christchurch, New Zealand
    Posts
    1,618
    What is doing the committing? The ODBC driver or the asp code??? Perhaps you could post your code and explain a bit more?

  3. #3
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •