38 |
|
interface |
39 |
|
|
40 |
|
uses |
41 |
< |
Classes, SysUtils, DB, IB, IBDatabase, IBTypes, IBSQLMonitor, IBExternals, memds; |
41 |
> |
Classes, SysUtils, DB, IB, IBDatabase, IBSQLMonitor, IBExternals, IBInternals, |
42 |
> |
memds; |
43 |
|
|
44 |
|
type |
45 |
|
TIBXCustomService = class; |
2348 |
|
end; |
2349 |
|
|
2350 |
|
procedure TIBXControlService.SetDatabaseName(AValue: string); |
2351 |
+ |
var ServerName, aDatabaseName: AnsiString; |
2352 |
+ |
Protocol: TProtocolAll; |
2353 |
+ |
PortNo: AnsiString; |
2354 |
|
begin |
2355 |
|
if FDatabaseName = AValue then Exit; |
2356 |
|
CheckServiceNotRunning; |
2357 |
< |
FDatabaseName := AValue; |
2358 |
< |
DatabaseNameChanged; |
2357 |
> |
if ParseConnectString(AValue,ServerName,aDatabaseName,Protocol,PortNo) then |
2358 |
> |
begin |
2359 |
> |
if (ServerName <> '') and (AnsiUpperCase(ServicesConnection.ServerName) <> AnsiUpperCase(ServerName)) then |
2360 |
> |
IBError(ibxeServerMismatch,[ServerName,ServicesConnection.ServerName]); |
2361 |
> |
FDatabaseName := aDatabaseName; |
2362 |
> |
DatabaseNameChanged; |
2363 |
> |
end |
2364 |
> |
else |
2365 |
> |
IBError(ibxeBadConnectString,[AValue]); |
2366 |
|
end; |
2367 |
|
|
2368 |
|
procedure TIBXControlService.DatabaseNameChanged; |
3033 |
|
try |
3034 |
|
{extact database file spec} |
3035 |
|
RegexObj.ModifierG := false; {turn off greedy matches} |
3036 |
< |
RegexObj.Expression := '[A-Z][A-Z]-V([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+) .*'; |
3036 |
> |
RegexObj.Expression := '[A-Z][A-Z]-[A-Z]([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+) .*'; |
3037 |
|
s := Results[0].AsString; |
3038 |
|
if RegexObj.Exec(s) then |
3039 |
|
begin |
3066 |
|
Connected := false; |
3067 |
|
if not ParseConnectString(AValue,FServerName,aServiceName,aProtocol,FPortNo) |
3068 |
|
or (aServiceName <> 'service_mgr') or (aProtocol = unknownProtocol) then |
3069 |
< |
IBError(ibxeBadConnectString, [nil]); |
3069 |
> |
IBError(ibxeBadConnectString, [AValue]); |
3070 |
|
FConnectString := AValue; |
3071 |
|
FProtocol := TProtocol(aProtocol); |
3072 |
|
end; |