ADO Connection Error in MTS

Results 1 to 4 of 4

Thread: ADO Connection Error in MTS

  1. #1
    Gladstone Alexander Guest

    Default ADO Connection Error in MTS

    I have some ASP code that works OK until I make the page transactional: transaction = required.<BR><BR>The problem occurs when I invoke the "Open" method of the ADO Connection object. I am using a DSNless connection. The Open method returns the following error:<BR><BR>"[Microsoft][ODBC Driver Manager] Illegal operation while in a transaction server component transaction."<BR><BR>The problem also occurs when I run the ASP scripts in an MTS Package. <BR><BR>I am running NT 4.0 SP5, IIS 4.0 with SP5 and SQL 7.0.<BR><BR>If I remove "transaction=required" from the page it works OK.<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: ADO Connection Error in MTS

    Are you also creating the Connection Object within the transactional page? Are you also closing all connections, recordsets, etc before leaving the page?<BR>

  3. #3
    Gladstone Alexander Guest

    Default RE: ADO Connection Error in MTS

    I am creating the Connection Object in a function, which is in an include file. The include file is is included in the transactional page. Thus I am creating the Connection Object within the transactional page. I do not do an explicit Connection.Close, but I set the connection object variable to Nothing. <BR><BR>The transactional page is as follows:<BR><BR>&#060;%@ LANGUAGE="VBSCRIPT" transaction = required %&#062;<BR>&#060;!-- #include virtual="/SSIncludes/" --&#062;<BR>&#060;script LANGUAGE="VBScript" RUNAT="Server"&#062;<BR>.<BR>.<BR>status = ActivateAccount(puuid, email, loginname, country, zipcode, password, date_of_birth, gender, new_act)<BR> <BR>The ActivateAccount Function is in the "" include file. In this function I do the following:<BR><BR>Set myCommand = Server.CreateObject("ADODB.Command")<BR>myCommand. CommandText = "spASP_ActivateAccount" <BR>myCommand.CommandType = adCmdStoredProc<BR> <BR>set myConnection = Server.CreateObject("ADODB.Connection")<BR>myConne ction.Open connectstring<BR>myCommand.ActiveConnection = myConnection<BR><BR>the line that fails is: myConnection.Open connectstring<BR> <BR>When I run this in the Debugger and try to step over this line it returns to the main transactional page immediately. That&#039s when I look at the Err object to find out what the error is.<BR><BR>Now when the page is not transactional it all works OK. The Debugger does a successful Step Over to the next line. Also the connection string is the same in both scenarios.<BR><BR>Thanks for any help you can give me.<BR>

  4. #4
    Gladstone Alexander Guest

    Default RE: The solution

    I finally solved the MTS Connection problem. I modified the Connection Object to use "SQLOLEDB" as the Provider instaed of "MSDASQL" and it worked OK. Apparently "MSDASQL" is the default. <BR><BR>

Posting Permissions

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