ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/branches/udr/client/IBUtils.pas
(Generate patch)

Comparing ibx/trunk/fbintf/IBUtils.pas (file contents):
Revision 117 by tony, Mon Jan 22 13:58:11 2018 UTC vs.
Revision 120 by tony, Mon Jan 22 13:58:20 2018 UTC

# Line 33 | Line 33
33  
34   unit IBUtils;
35   {$IFDEF MSWINDOWS}
36 < {$DEFINE WINDOWS}
36 > {$DEFINE WINDOWS}
37   {$ENDIF}
38  
39   {$IFDEF FPC}
40   {$Mode Delphi}
41   {$codepage UTF8}
42 + {$define HASREQEX}
43   {$ENDIF}
44  
45 +
46   interface
47  
48   uses Classes, SysUtils;
# Line 268 | Line 270 | function ExtractConnectString(const Crea
270  
271   implementation
272  
273 + {$IFDEF HASREQEX}
274   uses RegExpr;
275 + {$ENDIF}
276  
277   function Max(n1, n2: Integer): Integer;
278   begin
# Line 371 | Line 375 | end;
375  
376   {Extracts the Database Connect string from a Create Database Statement}
377  
378 + {$IFDEF HASREQEX}
379   function ExtractConnectString(const CreateSQL: AnsiString;
380    var ConnectString: AnsiString): boolean;
381   var RegexObj: TRegExpr;
# Line 388 | Line 393 | begin
393      RegexObj.Free;
394    end;
395   end;
396 + {$ELSE}
397 + {cruder version of above for old versions of Delphi}
398 + function ExtractConnectString(const CreateSQL: AnsiString;
399 +  var ConnectString: AnsiString): boolean;
400 + var i: integer;
401 + begin
402 +  Result := false;
403 +  i := Pos('''',CreateSQL);
404 +  if i > 0 then
405 +  begin
406 +    ConnectString := CreateSQL;
407 +    delete(ConnectString,1,i);
408 +    i := Pos('''',ConnectString);
409 +    if i > 0 then
410 +    begin
411 +      delete(ConnectString,i,Length(ConnectString)-i+1);
412 +      Result := true;
413 +    end;
414 +  end;
415 + end;
416 + {$ENDIF}
417  
418   {Format an SQL Identifier according to SQL Dialect with encapsulation if necessary}
419  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines