83 |
|
TFB25ServiceManager = class(TFBServiceManager,IServiceManager) |
84 |
|
private |
85 |
|
FHandle: TISC_SVC_HANDLE; |
86 |
+ |
FFirebird25ClientAPI: TFB25ClientAPI; |
87 |
|
procedure CheckActive; |
88 |
|
procedure CheckInactive; |
89 |
|
protected |
90 |
|
procedure InternalAttach(ConnectString: AnsiString); override; |
91 |
|
public |
92 |
+ |
constructor Create(api: TFB25ClientAPI; ServerName: AnsiString; Protocol: TProtocol; SPB: ISPB; Port: AnsiString = ''); |
93 |
|
property Handle: TISC_SVC_HANDLE read FHandle; |
94 |
|
|
95 |
|
public |
120 |
|
|
121 |
|
procedure TFB25ServiceManager.InternalAttach(ConnectString: AnsiString); |
122 |
|
begin |
123 |
< |
with Firebird25ClientAPI do |
123 |
> |
with FFirebird25ClientAPI do |
124 |
|
if FSPB = nil then |
125 |
|
begin |
126 |
|
if isc_service_attach(StatusVector, Length(ConnectString), |
137 |
|
end; |
138 |
|
end; |
139 |
|
|
140 |
+ |
constructor TFB25ServiceManager.Create(api: TFB25ClientAPI; |
141 |
+ |
ServerName: AnsiString; Protocol: TProtocol; SPB: ISPB; Port: AnsiString); |
142 |
+ |
begin |
143 |
+ |
FFirebird25ClientAPI := api; |
144 |
+ |
inherited Create(api,ServerName, Protocol, SPB, Port); |
145 |
+ |
end; |
146 |
+ |
|
147 |
|
procedure TFB25ServiceManager.Detach(Force: boolean); |
148 |
|
begin |
149 |
|
if FHandle = nil then |
150 |
|
Exit; |
151 |
< |
with Firebird25ClientAPI do |
151 |
> |
with FFirebird25ClientAPI do |
152 |
|
if isc_service_detach(StatusVector, @FHandle) > 0 then |
153 |
|
begin |
154 |
|
FHandle := nil; |
169 |
|
begin |
170 |
|
Result := true; |
171 |
|
CheckActive; |
172 |
< |
with Firebird25ClientAPI do |
172 |
> |
with FFirebird25ClientAPI do |
173 |
|
begin |
174 |
|
Result := isc_service_start(StatusVector, @FHandle, nil, |
175 |
|
(Request as TSRB).getDataLength, |
184 |
|
var QueryResults: TServiceQueryResults; |
185 |
|
begin |
186 |
|
CheckActive; |
187 |
< |
QueryResults := TServiceQueryResults.Create; |
187 |
> |
QueryResults := TServiceQueryResults.Create(FFirebird25ClientAPI); |
188 |
|
Result := QueryResults; |
189 |
< |
with Firebird25ClientAPI do |
189 |
> |
with FFirebird25ClientAPI do |
190 |
|
if SQPB = nil then |
191 |
|
begin |
192 |
|
if isc_service_query(StatusVector, @FHandle, nil,0,nil, |