Problem with Transactions using Delphi1+MS-SQL SERVER 
Author Message
 Problem with Transactions using Delphi1+MS-SQL SERVER

I have not been able to find a successful method of using transactions
with delphi 1 Tquery and MS SQL SERVER.

I want to be able to execute the BEGIN TRANSACTION sql command followed
by several Insert/Update commands using TQuery. Then execute
the COMMIT TRANSACTION command or the ROLLBACK TRANSACTION command.

The problem seems to be that irrespective of whether a Begin Transaction
command has been sent to the server (via a TQuery or using the TDatabase
StartTransaction method), all inserts and updates are committed as they
are executed. The Rollback Transaction command (or the
TDatabase.Rolback) has no effect.

I am using the ODBC driver supplied with MS SQL SERVER 6.5.

Does anyone know of a way around this problem?

Roger Walker




Mon, 31 May 1999 03:00:00 GMT  
 Problem with Transactions using Delphi1+MS-SQL SERVER

Quote:

> I have not been able to find a successful method of using transactions
> with Delphi 1 Tquery and MS SQL SERVER.

> I want to be able to execute the BEGIN TRANSACTION sql command followed
> by several Insert/Update commands using TQuery. Then execute
> the COMMIT TRANSACTION command or the ROLLBACK TRANSACTION command.

> The problem seems to be that irrespective of whether a Begin Transaction
> command has been sent to the server (via a TQuery or using the TDatabase
> StartTransaction method), all inserts and updates are committed as they
> are executed. The Rollback Transaction command (or the
> TDatabase.Rolback) has no effect.

> I am using the ODBC driver supplied with MS SQL SERVER 6.5.

> Does anyone know of a way around this problem?

> Roger Walker



Check the SQLPASSTHRU MODE for the Database Alias in the IDAPI.CFG
using the BDE configuration utility. If it is SHARED AUTOCOMMIT, change
it to SHARED NOAUTOCOMMIT. That should do it.

Hope this helps,

Vijay
R&D Manager, Database Engine and Connectivity
Borland



Mon, 31 May 1999 03:00:00 GMT  
 Problem with Transactions using Delphi1+MS-SQL SERVER

Quote:


> > I have not been able to find a successful method of using transactions
> > with Delphi 1 Tquery and MS SQL SERVER.

> > I want to be able to execute the BEGIN TRANSACTION sql command followed
> > by several Insert/Update commands using TQuery. Then execute
> > the COMMIT TRANSACTION command or the ROLLBACK TRANSACTION command.

> > The problem seems to be that irrespective of whether a Begin Transaction
> > command has been sent to the server (via a TQuery or using the TDatabase
> > StartTransaction method), all inserts and updates are committed as they
> > are executed. The Rollback Transaction command (or the
> > TDatabase.Rolback) has no effect.

> > I am using the ODBC driver supplied with MS SQL SERVER 6.5.

> > Does anyone know of a way around this problem?

> > Roger Walker


> Check the SQLPASSTHRU MODE for the Database Alias in the IDAPI.CFG
> using the BDE configuration utility. If it is SHARED AUTOCOMMIT, change
> it to SHARED NOAUTOCOMMIT. That should do it.

> Hope this helps,

> Vijay
> R&D Manager, Database Engine and Connectivity
> Borland

That solved the problem - thanks for your quick response.

Roger



Tue, 01 Jun 1999 03:00:00 GMT  
 Problem with Transactions using Delphi1+MS-SQL SERVER



Quote:
>I have not been able to find a successful method of using transactions
>with Delphi 1 Tquery and MS SQL SERVER.

>I want to be able to execute the BEGIN TRANSACTION sql command followed
>by several Insert/Update commands using TQuery. Then execute
>the COMMIT TRANSACTION command or the ROLLBACK TRANSACTION command.

>The problem seems to be that irrespective of whether a Begin Transaction
>command has been sent to the server (via a TQuery or using the TDatabase
>StartTransaction method), all inserts and updates are committed as they
>are executed. The Rollback Transaction command (or the
>TDatabase.Rolback) has no effect.

>I am using the ODBC driver supplied with MS SQL SERVER 6.5.

>Does anyone know of a way around this problem?

First, ODBC drivers usually have AutoCommit option. Try looking
for it.

Second, I don't quite understand how one can use ODBC
for MS SQL in Delphi. I simply created an alias pointing to
MS SQL Database. BDE is supposed to use some "native" driver
to MS SQL Server, not wimpy ODBC.

Oleg.



Sun, 06 Jun 1999 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Using Delphi1 and SQL Anywhere Server on Network???

2. Read MS SQL Server database Transaction log ?

3. Transactions in MS-SQL Server 6.5.

4. Transaction Isolation Level in MS SQL Server 6.5

5. SQL Links problem with MS SQL Server

6. Hang up when using D1 + ODBC + MS SQL Server 6.5

7. Connecting to MS SQL server using NT security

8. Problem with Delphi and MS SQL Server

9. MS SQL Server Driver Problem

10. Delphi & MS-SQL Server - datefield problems

11. MS SQL Server Strange Problem

12. Solution to MS SQL Server ODBC access problem with Delphi

 

 
Powered by phpBB® Forum Software