mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-08 15:26:21 +02:00
* TIBConnection.Dialect is read-only as it is implemened now. And public, not published.
* Check if the database is connected in TIBConnection.SetDialect * Changed error-buffer size (ibconnection) * TCustomConnection.StreamedConnected is protected * Initialize TDatabase.FConnected to false git-svn-id: trunk@8913 -
This commit is contained in:
parent
3e7e3dc2eb
commit
8a66698bc4
@ -60,6 +60,7 @@ begin
|
||||
FParams:=TStringlist.Create;
|
||||
FDatasets:=TList.Create;
|
||||
FTransactions:=TList.Create;
|
||||
FConnected:=False;
|
||||
end;
|
||||
|
||||
destructor TDatabase.Destroy;
|
||||
|
@ -1562,6 +1562,7 @@ type
|
||||
procedure InternalHandleException; virtual;
|
||||
procedure Loaded; override;
|
||||
procedure SetConnected (Value : boolean); virtual;
|
||||
property Streamedconnected: Boolean read FStreamedConnected write FStreamedConnected;
|
||||
public
|
||||
procedure Close;
|
||||
destructor Destroy; override;
|
||||
@ -1571,7 +1572,6 @@ type
|
||||
published
|
||||
property Connected: Boolean read GetConnected write SetConnected;
|
||||
property LoginPrompt: Boolean read FLoginPrompt write FLoginPrompt;
|
||||
property Streamedconnected: Boolean read FStreamedConnected write FStreamedConnected;
|
||||
|
||||
property AfterConnect : TNotifyEvent read FAfterConnect write SetAfterConnect;
|
||||
property AfterDisconnect : TNotifyEvent read FAfterDisconnect write SetAfterDisconnect;
|
||||
|
@ -95,8 +95,8 @@ type
|
||||
procedure CreateDB; override;
|
||||
procedure DropDB; override;
|
||||
property BlobSegmentSize : word read FBlobSegmentSize write FBlobSegmentSize;
|
||||
property Dialect : integer read GetDialect;
|
||||
published
|
||||
property Dialect : integer read GetDialect write FDialect;
|
||||
property DatabaseName;
|
||||
property KeepConnection;
|
||||
property LoginPrompt;
|
||||
@ -133,7 +133,7 @@ type
|
||||
|
||||
procedure TIBConnection.CheckError(ProcName : string; Status : PISC_STATUS);
|
||||
var
|
||||
buf : array [0..1024] of char;
|
||||
buf : array [0..1023] of char;
|
||||
Msg : string;
|
||||
E : EIBDatabaseError;
|
||||
Err : longint;
|
||||
@ -332,25 +332,28 @@ var
|
||||
Buffer : array [0..1] of byte;
|
||||
ResBuf : array [0..39] of byte;
|
||||
begin
|
||||
Buffer[0] := isc_info_db_sql_dialect;
|
||||
Buffer[1] := isc_info_end;
|
||||
if isc_database_info(@FStatus[0], @FSQLDatabaseHandle, Length(Buffer),
|
||||
pchar(@Buffer[0]), SizeOf(ResBuf), pchar(@ResBuf[0])) <> 0 then
|
||||
CheckError('SetDBDialect', FStatus);
|
||||
x := 0;
|
||||
while x < 40 do
|
||||
case ResBuf[x] of
|
||||
isc_info_db_sql_dialect :
|
||||
begin
|
||||
Inc(x);
|
||||
Len := isc_vax_integer(pchar(@ResBuf[x]), 2);
|
||||
Inc(x, 2);
|
||||
FDialect := isc_vax_integer(pchar(@ResBuf[x]), Len);
|
||||
Inc(x, Len);
|
||||
end;
|
||||
isc_info_end : Break;
|
||||
else
|
||||
inc(x);
|
||||
if Connected then
|
||||
begin
|
||||
Buffer[0] := isc_info_db_sql_dialect;
|
||||
Buffer[1] := isc_info_end;
|
||||
if isc_database_info(@FStatus[0], @FSQLDatabaseHandle, Length(Buffer),
|
||||
pchar(@Buffer[0]), SizeOf(ResBuf), pchar(@ResBuf[0])) <> 0 then
|
||||
CheckError('SetDBDialect', FStatus);
|
||||
x := 0;
|
||||
while x < 40 do
|
||||
case ResBuf[x] of
|
||||
isc_info_db_sql_dialect :
|
||||
begin
|
||||
Inc(x);
|
||||
Len := isc_vax_integer(pchar(@ResBuf[x]), 2);
|
||||
Inc(x, 2);
|
||||
FDialect := isc_vax_integer(pchar(@ResBuf[x]), Len);
|
||||
Inc(x, Len);
|
||||
end;
|
||||
isc_info_end : Break;
|
||||
else
|
||||
inc(x);
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user