
//////////////////////////////////////////////////
//  DBF Data Access Components
//  Copyright © 2008-2014 Devart. All right reserved.
//////////////////////////////////////////////////

{$IFNDEF CLR}

{$I DBFDac.inc}
unit DBFServicesUni;
{$ENDIF}

interface

uses
{$IFNDEF CLR}
  CLRClasses,
{$ELSE}
  System.Text,
{$ENDIF}
  SysUtils, Classes, Variants, DB,
  CRTypes, MemData, {$IFNDEF FPC}MemDS{$ELSE}MemDataSet{$ENDIF},
  CRParser, CRAccess, DBAccess, DAScript, DADump,
{$IFNDEF UNIDACPRO}
  ODBCClasses, ODBCParser, ODBCCall, ODBCServices, DBFClasses;
{$ELSE}
  ODBCClassesUni, ODBCParserUni, ODBCCallUni, ODBCServicesUni, DBFClassesUni;
{$ENDIF}

type

{  TCustomDBFDataSetUpdater }

  TCustomDBFDataSetUpdater = class(TCustomODBCDataSetUpdater)
  protected
    function GetIdentityFieldValue(out Value: variant): boolean; override;
  end;

{ TCustomDBFDataSetService }

  TCustomDBFDataSetService = class(TCustomODBCDataSetService)
  protected
    procedure CreateDataSetUpdater; override;
  end;

implementation

{ TCustomDBFDataSetUpdater }

function TCustomDBFDataSetUpdater.GetIdentityFieldValue(out Value: variant): boolean;
begin
  Value := SelectDBValue('Get identity value', 'SELECT @@IDENTITY');
  Result := True;
end;

{ TCustomDBFDataSetService }

procedure TCustomDBFDataSetService.CreateDataSetUpdater;
begin
  SetDataSetUpdater(TCustomDBFDataSetUpdater.Create(Self));
end;

end.
