1. Steve Mason
  2. PowerBuilder
  3. Friday, 22 June 2018 20:09 PM UTC

I am attempting to change a Powerbuilder 2017 R2 application that works using OLE to use the SQL Native Client for SQL Server interface
(SNC).  The database is SQL Server 2008 R2.

The connection parameters are:
dbparm="Provider='SQLNCLI10',TrustedConnection=0,Database='QRecordDev',appname='ERRD 3.6.1',host='QUADRAS30'"

The program successfully connects to the database and calls multiple stored procedures.  When the program executes the following statements
as_SQLStatement = 'begin transaction'
execute immediate :as_SQLStatement using this;

the following error occurs:
sqldbcode = 3997
sqlerrtext = SQLSTATE = 42000  Microsoft SQL Server Native Client 10.0  A transaction that was started in a MARS batch is still active at the end of the batch. The transaction is rolled back.

Do I need different connection parameters?



Chris Harmon Accepted Answer Pending Moderation
  1. Tuesday, 26 June 2018 06:25 AM UTC
  2. PowerBuilder
  3. # 1

MARS is on by default for SQL Serve connections. You need to add the following to your DBPam on the transaction:

ProviderString='MARS Connection=FALSE;'

Hope you get it working


There are no comments made yet.
Michael Kramer Accepted Answer Pending Moderation
  1. Friday, 22 June 2018 20:28 PM UTC
  2. PowerBuilder
  3. # 2

Hi Steve,

Are you using SQLCA.Autocommit = true?

You don't need BEGIN/END tran when  Autocommit = false.

HTH /Michael

There are no comments made yet.
  • Page :
  • 1

There are no replies made for this question yet.
However, you are not allowed to reply to this question.