AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Datenbanken Delphi ADODB Transaction and MSSQL
Thema durchsuchen
Ansicht
Themen-Optionen

ADODB Transaction and MSSQL

Ein Thema von miroslaw · begonnen am 14. Jan 2007 · letzter Beitrag vom 15. Jan 2007
 
miroslaw

Registriert seit: 14. Jan 2007
3 Beiträge
 
#1

ADODB Transaction and MSSQL

  Alt 14. Jan 2007, 23:21
Datenbank: MSSQL 2005 Express • Zugriff über: ADO
Hello,

I'd like to use transactions accessing MSSQL 2005. I'm using Delphi 5.
The following code causes Ole exception:

Delphi-Quellcode:
    _conId := TADOConnection.Create (nil);

    _conId.ConnectionString := ConnString;
    _conId.IsolationLevel := ilSerializable;
    _conId.LoginPrompt := False;
    _conId.CursorLocation := clUseClient;
    _conId.Mode := cmShareExclusive ;
    _conId.Open('mirek2', 'mirek2');

    _qrySelectCircle := TADOQuery.Create(nil);
    _qrySelectCircle.SQL.Text := 'SELECT VALUE FROM TAB WHERE NAME = :Name';
    with _qrySelectCircle.Parameters.AddParameter do
    begin
        Name := 'Name';
       DataType := ftString;
        Direction := pdInput;
    end;
    _qrySelectCircle.Prepared := True;
    _qrySelectCircle.Connection := _conId;

    _conId.BeginTrans();

   _qrySelectCircle.Parameters.ParamByName('Name').Value := circle;
   _qrySelectCircle.CursorType := ctKeyset   ;
   _qrySelectCircle.LockType := ltOptimistic;
   _qrySelectCircle.RecordSet := nil;
   _qrySelectCircle.Open();
At this point an exception occurs:

In German:
"Mehrfache Recordsets sind bei einer Transaktion mit diesem Cursortyp nich
t moeglich. Aendern Sie entweder den Cursortyp, fuehren Sie Commit fuer die Transakt
ion aus, oder schliessen Sie eines der Recordsets"

which translates into english
"multiple recordsets are not possible for a transaction with this cursor type. Change either the cursor type or execute commit or close one record set"

What am I doing wrong and how can I fix it. I really need the transactios.

Thanks in advance
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 10:10 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz