📄 sqlmergxlib_tlb.pas
字号:
property DistributorPassword: WideString index 10 read GetWideStringProp write SetWideStringProp stored False;
property Subscriber: WideString index 11 read GetWideStringProp write SetWideStringProp stored False;
property SubscriberDatabase: WideString index 12 read GetWideStringProp write SetWideStringProp stored False;
property SubscriberSecurityMode: TOleEnum index 13 read GetTOleEnumProp write SetTOleEnumProp stored False;
property SubscriberLogin: WideString index 14 read GetWideStringProp write SetWideStringProp stored False;
property SubscriberPassword: WideString index 15 read GetWideStringProp write SetWideStringProp stored False;
property SubscriberDatasourceType: TOleEnum index 16 read GetTOleEnumProp write SetTOleEnumProp stored False;
property SubscriberDatabasePath: WideString index 17 read GetWideStringProp write SetWideStringProp stored False;
property SubscriptionType: TOleEnum index 18 read GetTOleEnumProp write SetTOleEnumProp stored False;
property ExchangeType: TOleEnum index 19 read GetTOleEnumProp write SetTOleEnumProp stored False;
property LoginTimeout: Smallint index 20 read GetSmallintProp write SetSmallintProp stored False;
property QueryTimeout: Smallint index 21 read GetSmallintProp write SetSmallintProp stored False;
property FTPAddress: WideString index 22 read GetWideStringProp write SetWideStringProp stored False;
property FTPPort: Integer index 23 read GetIntegerProp write SetIntegerProp stored False;
property FTPLogin: WideString index 24 read GetWideStringProp write SetWideStringProp stored False;
property FTPPassword: WideString index 25 read GetWideStringProp write SetWideStringProp stored False;
property DistributorAddress: WideString index 26 read GetWideStringProp write SetWideStringProp stored False;
property DistributorNetwork: TOleEnum index 27 read GetTOleEnumProp write SetTOleEnumProp stored False;
property PublisherAddress: WideString index 28 read GetWideStringProp write SetWideStringProp stored False;
property PublisherNetwork: TOleEnum index 29 read GetTOleEnumProp write SetTOleEnumProp stored False;
property Validate: TOleEnum index 34 read GetTOleEnumProp write SetTOleEnumProp stored False;
property ProfileName: WideString index 44 read GetWideStringProp write SetWideStringProp stored False;
property HostName: WideString index 46 read GetWideStringProp write SetWideStringProp stored False;
property SubscriptionName: WideString index 47 read GetWideStringProp write SetWideStringProp stored False;
property AltSnapshotFolder: WideString index 49 read GetWideStringProp write SetWideStringProp stored False;
property WorkingDirectory: WideString index 50 read GetWideStringProp write SetWideStringProp stored False;
property FileTransferType: TOleEnum index 51 read GetTOleEnumProp write SetTOleEnumProp stored False;
property UseInteractiveResolver: WordBool index 53 read GetWordBoolProp write SetWordBoolProp stored False;
property SyncToAlternate: WordBool index 55 read GetWordBoolProp write SetWordBoolProp stored False;
property SubscriptionPriorityType: TOleEnum index 56 read GetTOleEnumProp write SetTOleEnumProp stored False;
property SubscriptionPriority: Single index 57 read GetSingleProp write SetSingleProp stored False;
property SynchronizationType: TOleEnum index 58 read GetTOleEnumProp write SetTOleEnumProp stored False;
property DynamicSnapshotLocation: WideString index 59 read GetWideStringProp write SetWideStringProp stored False;
property OnStatus: TSQLMergeStatus read FOnStatus write FOnStatus;
end;
// *********************************************************************//
// The Class CoAlternateSyncPartner provides a Create and CreateRemote method to
// create instances of the default interface IAlternateSyncPartner exposed by
// the CoClass AlternateSyncPartner. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoAlternateSyncPartner = class
class function Create: IAlternateSyncPartner;
class function CreateRemote(const MachineName: string): IAlternateSyncPartner;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TAlternateSyncPartner
// Help String : AlternateSyncPartner Class
// Default Interface: IAlternateSyncPartner
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TAlternateSyncPartnerProperties= class;
{$ENDIF}
TAlternateSyncPartner = class(TOleServer)
private
FIntf: IAlternateSyncPartner;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TAlternateSyncPartnerProperties;
function GetServerProperties: TAlternateSyncPartnerProperties;
{$ENDIF}
function GetDefaultInterface: IAlternateSyncPartner;
protected
procedure InitServerData; override;
function Get_FriendlyName: WideString;
procedure Set_FriendlyName(const pVal: WideString);
function Get_Distributor: WideString;
procedure Set_Distributor(const pVal: WideString);
function Get_Publication: WideString;
procedure Set_Publication(const pVal: WideString);
function Get_PublisherDatabase: WideString;
procedure Set_PublisherDatabase(const pVal: WideString);
function Get_Publisher: WideString;
procedure Set_Publisher(const pVal: WideString);
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IAlternateSyncPartner);
procedure Disconnect; override;
property DefaultInterface: IAlternateSyncPartner read GetDefaultInterface;
property FriendlyName: WideString read Get_FriendlyName write Set_FriendlyName;
property Distributor: WideString read Get_Distributor write Set_Distributor;
property Publication: WideString read Get_Publication write Set_Publication;
property PublisherDatabase: WideString read Get_PublisherDatabase write Set_PublisherDatabase;
property Publisher: WideString read Get_Publisher write Set_Publisher;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TAlternateSyncPartnerProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TAlternateSyncPartner
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TAlternateSyncPartnerProperties = class(TPersistent)
private
FServer: TAlternateSyncPartner;
function GetDefaultInterface: IAlternateSyncPartner;
constructor Create(AServer: TAlternateSyncPartner);
protected
function Get_FriendlyName: WideString;
procedure Set_FriendlyName(const pVal: WideString);
function Get_Distributor: WideString;
procedure Set_Distributor(const pVal: WideString);
function Get_Publication: WideString;
procedure Set_Publication(const pVal: WideString);
function Get_PublisherDatabase: WideString;
procedure Set_PublisherDatabase(const pVal: WideString);
function Get_Publisher: WideString;
procedure Set_Publisher(const pVal: WideString);
public
property DefaultInterface: IAlternateSyncPartner read GetDefaultInterface;
published
property FriendlyName: WideString read Get_FriendlyName write Set_FriendlyName;
property Distributor: WideString read Get_Distributor write Set_Distributor;
property Publication: WideString read Get_Publication write Set_Publication;
property PublisherDatabase: WideString read Get_PublisherDatabase write Set_PublisherDatabase;
property Publisher: WideString read Get_Publisher write Set_Publisher;
end;
{$ENDIF}
// *********************************************************************//
// The Class CoAlternateSyncPartners provides a Create and CreateRemote method to
// create instances of the default interface IAlternateSyncPartners exposed by
// the CoClass AlternateSyncPartners. The functions are intended to be used by
// clients wishing to automate the CoClass objects exposed by the
// server of this typelibrary.
// *********************************************************************//
CoAlternateSyncPartners = class
class function Create: IAlternateSyncPartners;
class function CreateRemote(const MachineName: string): IAlternateSyncPartners;
end;
// *********************************************************************//
// OLE Server Proxy class declaration
// Server Object : TAlternateSyncPartners
// Help String : AlternateSyncPartners Class
// Default Interface: IAlternateSyncPartners
// Def. Intf. DISP? : No
// Event Interface:
// TypeFlags : (2) CanCreate
// *********************************************************************//
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
TAlternateSyncPartnersProperties= class;
{$ENDIF}
TAlternateSyncPartners = class(TOleServer)
private
FIntf: IAlternateSyncPartners;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
FProps: TAlternateSyncPartnersProperties;
function GetServerProperties: TAlternateSyncPartnersProperties;
{$ENDIF}
function GetDefaultInterface: IAlternateSyncPartners;
protected
procedure InitServerData; override;
function Get_Item(varIndex: OleVariant): IAlternateSyncPartner;
function Get_Count: Integer;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
procedure Connect; override;
procedure ConnectTo(svrIntf: IAlternateSyncPartners);
procedure Disconnect; override;
procedure Add(const pPartner: IAlternateSyncPartner);
procedure Clear;
property DefaultInterface: IAlternateSyncPartners read GetDefaultInterface;
property Item[varIndex: OleVariant]: IAlternateSyncPartner read Get_Item; default;
property Count: Integer read Get_Count;
published
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
property Server: TAlternateSyncPartnersProperties read GetServerProperties;
{$ENDIF}
end;
{$IFDEF LIVE_SERVER_AT_DESIGN_TIME}
// *********************************************************************//
// OLE Server Properties Proxy Class
// Server Object : TAlternateSyncPartners
// (This object is used by the IDE's Property Inspector to allow editing
// of the properties of this server)
// *********************************************************************//
TAlternateSyncPartnersProperties = class(TPersistent)
private
FServer: TAlternateSyncPartners;
function GetDefaultInterface: IAlternateSyncPartners;
constructor Create(AServer: TAlternateSyncPartners);
protected
function Get_Item(varIndex: OleVariant): IAlternateSyncPartner;
function Get_Count: Integer;
public
property DefaultInterface: IAlternateSyncPartners read GetDefaultInterface;
published
end;
{$ENDIF}
procedure Register;
resourcestring
dtlServerPage = 'ActiveX';
implementation
uses ComObj;
procedure TSQLMerge.InitControlData;
const
CEventDispIDs: array [0..0] of DWORD = (
$00000001);
CControlData: TControlData2 = (
ClassID: '{08B0B2E8-3FB3-11D3-A4DE-00C04F610189}';
EventIID: '{84923186-F94B-11D0-A8E8-00C04FC2DEB3}';
EventCount: 1;
EventDispIDs: @CEventDispIDs;
LicenseKey: nil (*HR:$80004002*);
Flags: $00000000;
Version: 401);
begin
ControlData := @CControlData;
TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnStatus) - Cardinal(Self);
end;
procedure TSQLMerge.CreateControl;
procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as ISQLMerge;
end;
begin
if FIntf = nil then DoCreate;
end;
function TSQLMerge.GetControlInterface: ISQLMerge;
begin
CreateControl;
Result := FIntf;
end;
function TSQLMerge.Get_ErrorRecords: ISQLReplErrors;
begin
Result := DefaultInterface.ErrorRecords;
end;
function TSQLMerge.Get_AlternateSyncPartners: IAlternateSyncPartners;
begin
Result := DefaultInterface.AlternateSyncPartners;
end;
procedure TSQLMerge.Initialize;
begin
DefaultInterface.Initialize;
end;
procedure TSQLMerge.AddSubscription(DBADDOPTION: DBADDOPTION; SubscriptionHost: SUBSCRIPTION_HOST);
begin
DefaultInterface.AddSubscription(DBADDOPTION, SubscriptionHost);
end;
procedure TSQLMerge.DropSubscription(DBDROPOPTION: DBDROPOPTION);
begin
DefaultInterface.DropSubscription(DBDROPOPTION);
end;
procedure TSQLMerge.Run;
begin
DefaultInterface.Run;
end;
procedure TSQLMerge.Terminate;
begin
DefaultInterface.Terminate;
end;
procedure TSQLMerge.ReinitializeSubscription(bUploadBeforeReinit: WordBool);
begin
DefaultInterface.ReinitializeSubscription(bUploadBeforeReinit);
end;
procedure TSQLMerge.CopySubscription(const bstrSubscriptionFileName: WideString;
FileCreateOption: FILECREATE_OPTION);
begin
DefaultInterface.CopySubscription(bstrSubscriptionFileName, FileCreateOption);
end;
class function CoAlternateSyncPartner.Create: IAlternateSyncPartner;
begin
Result := CreateComObject(CLASS_AlternateSyncPartner) as IAlternateSyncPartner;
end;
class function CoAlternateSyncPartner.CreateRemote(const MachineName: string): IAlternateSyncPartner;
begin
Result := CreateRemoteComObject(MachineName, CLASS_AlternateSyncPartner) as IAlternateSyncPartner;
end;
procedure TAlternateSyncPartner.InitServerData;
const
CServerData: TServerData = (
ClassID: '{0A98450E-04A9-11D3-A8FB-00C04F9FC436}';
IntfIID: '{0A98450D-04A9-11D3-A8FB-00C04F9FC436}';
EventIID: '';
LicenseKey: nil;
Version: 500);
begin
ServerData := @CServerData;
end;
procedure TAlternateSyncPartner.Connect;
var
punk: IUnknown;
begin
if FIntf = nil then
begin
punk := GetServer;
Fintf:= punk as IAlternateSyncPartner;
end;
end;
procedure TAlternateSyncPartner.ConnectTo(svrIntf: IAlternateSyncPartner);
begin
Disconnect;
FIntf := svrIntf;
end;
procedure TAlternateSyncPartner.DisConnect;
begin
if Fintf <> nil then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -