BeginTrans Error

Results 1 to 2 of 2

Thread: BeginTrans Error

  1. #1
    chris klanac Guest

    Default BeginTrans Error

    I&#039;ve been using the code (show below) on several servers in various situations with no problem... <BR>But now I&#039;m tring to use it on a different server and I get the folling error? The server seems to have a problem with the TRANSACTION=Required declartion combined with the BeginTrans... but I&#039;m not sure how to fix it. <BR><BR>Any Thoughts??? <BR><BR>BTW. The server is NT 4.0 <BR><BR>Error Type: <BR>Microsoft OLE DB Provider for ODBC Drivers (0x8004D013) <BR>[Microsoft][ODBC Driver Manager] Illegal operation while in a transaction server component transaction <BR>/data/save.asp, line 10 <BR><BR>&#060;%@ TRANSACTION = Required LANGUAGE = "VBScript" %&#062; <BR><BR>&#060;!--METADATA NAME="Microsoft ActiveX Data Objects 2.5 Library" TYPE="TypeLib" UUID="{00000205-0000-0010-8000-00AA006D2EA4}"--&#062; <BR><BR><BR>&#060;% <BR><BR>Set cnnObj = Server.CreateObject("ADODB.Connection") <BR>cnnObj.Open "File Name=D:DSNSMyDataBase.udl" <BR>cnnObj.BeginTrans &#039;&#060;&#060;== LINE 10 ERRROR MESSAGE REFERS TO THIS LINE <BR><BR>Set myRst = Server.CreateObject("ADODB.Recordset") <BR>myRst.Open "select * from myTable", cnnObj, adOpenKeyset, adLockBatchOptimistic, adCmdText <BR><BR>&#039;DO Updates Here... <BR><BR>myRst.Update() <BR><BR><BR>&#039;CHECK IF FOR ERROR THEN COMMIT <BR>If cnnObj.Errors.Count = 0) Then <BR> ObjectContext.SetComplete &#039;calls the onTransactionCommit <BR>Else <BR> ObjectContext.SetAbort &#039;Calls the onTransactionAbort <BR>End If <BR><BR><BR>Sub OnTransactionCommit() <BR> cnnObj.CommitTrans <BR>End Sub <BR><BR><BR>Sub OnTransactionAbort() <BR> cnnObj.RollbackTrans <BR>End Sub <BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: BeginTrans Error

    Try beginning your transaction AFTER the select...<BR><BR>KLC

Posting Permissions

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