Received: from bush.rutgersinsurance.com (rutgersinsurance.com [38.138.71.194]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f0GDkD086987 for ; Tue, 16 Jan 2001 08:46:13 -0500 (EST) (envelope-from aalang@rutgersinsurance.com) Received: from 6014cwpza006 ([10.10.10.51]) by bush.rutgersinsurance.com (8.9.3/8.9.3) with SMTP id IAA24041 for ; Tue, 16 Jan 2001 08:50:01 -0500 Message-ID: <006f01c07fc2$f46952a0$330a0a0a@6014cwpza006> From: "Adam Lang" To: References: <043001c07e79$2f4ad5b0$11841618@indpdnce1.mo.home.com> Subject: Re: Turn off implicit BEGIN from ODBC driver on Windows? Date: Tue, 16 Jan 2001 08:48:06 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200101/157 X-Sequence-Number: 771 Did you try putting a couple SQL statements between the BeginTrans and CommitTrans and see what happened? Adam Lang Systems Engineer Rutgers Casualty Insurance Company http://www.rutgersinsurance.com ----- Original Message ----- From: "Doug Haddan" To: Sent: Sunday, January 14, 2001 5:27 PM Subject: [INTERFACES] Turn off implicit BEGIN from ODBC driver on Windows? Two questions really... (1) Is there a way to turn off the implicit BEGIN that PsqlODBC sends to PostgreSQL? I want to use multiple SQL statements within transactions. (2) Is there a way to stop PsqlODBC from sending ABORT when disconnnected and there is no transaction in progress? (Not so critical as first question.) I know that the ODBC driver is sending the BEGIN and ABORT on its own by viewing the psqlodbc_%.log file and observing postmaster response. I am using... + PostgreSQL v7.0.3 (on Linux) + PsqlODBC v6.50 + Microsoft Windows NT SP6a + Microsoft Visual Basic 6 SP4 + Microsoft ADO v3.520.5303.2 Following is a code sample with comments. ------------------------------------------------------------------- Dim cn As ADODB.Connection Set cn = New ADODB.Connection With cn .ConnectionString = MyConnectionString .Open .BeginTrans '<--- Seems to be ignored by ODBC driver. .CommitTrans '<--- Seems to be ignored by ODBC driver. End With Dim rs As ADODB.Recordset Set rs = New ADODB.Recordset With rs .ActiveConnection = cn .Source = "BEGIN WORK;" .Open '-- At this point, the ODBC driver sends "BEGIN" and "BEGIN WORK;" '-- to PostgreSQL and the postmaster complains by displaying the '-- message "BEGIN: already a transaction in progress. .Source = "COMMIT WORK;" .Open '<--- Seems to work OK. End With cn.Close Set rs = Nothing Set cn = Nothing End '-- The ODBC driver sends "ABORT" to PostgreSQL. The postmaster '-- displays "ROLLBACK: no transaction in progress" and displays the '-- message "pg_recvbuf: unexpected EOF on client connection". ------------------------------------------------------------------- Any help would be appreciated. Thanks! Doug