mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-10 19:45:59 +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;
|
FParams:=TStringlist.Create;
|
||||||
FDatasets:=TList.Create;
|
FDatasets:=TList.Create;
|
||||||
FTransactions:=TList.Create;
|
FTransactions:=TList.Create;
|
||||||
|
FConnected:=False;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TDatabase.Destroy;
|
destructor TDatabase.Destroy;
|
||||||
|
@ -1562,6 +1562,7 @@ type
|
|||||||
procedure InternalHandleException; virtual;
|
procedure InternalHandleException; virtual;
|
||||||
procedure Loaded; override;
|
procedure Loaded; override;
|
||||||
procedure SetConnected (Value : boolean); virtual;
|
procedure SetConnected (Value : boolean); virtual;
|
||||||
|
property Streamedconnected: Boolean read FStreamedConnected write FStreamedConnected;
|
||||||
public
|
public
|
||||||
procedure Close;
|
procedure Close;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -1571,7 +1572,6 @@ type
|
|||||||
published
|
published
|
||||||
property Connected: Boolean read GetConnected write SetConnected;
|
property Connected: Boolean read GetConnected write SetConnected;
|
||||||
property LoginPrompt: Boolean read FLoginPrompt write FLoginPrompt;
|
property LoginPrompt: Boolean read FLoginPrompt write FLoginPrompt;
|
||||||
property Streamedconnected: Boolean read FStreamedConnected write FStreamedConnected;
|
|
||||||
|
|
||||||
property AfterConnect : TNotifyEvent read FAfterConnect write SetAfterConnect;
|
property AfterConnect : TNotifyEvent read FAfterConnect write SetAfterConnect;
|
||||||
property AfterDisconnect : TNotifyEvent read FAfterDisconnect write SetAfterDisconnect;
|
property AfterDisconnect : TNotifyEvent read FAfterDisconnect write SetAfterDisconnect;
|
||||||
|
@ -95,8 +95,8 @@ type
|
|||||||
procedure CreateDB; override;
|
procedure CreateDB; override;
|
||||||
procedure DropDB; override;
|
procedure DropDB; override;
|
||||||
property BlobSegmentSize : word read FBlobSegmentSize write FBlobSegmentSize;
|
property BlobSegmentSize : word read FBlobSegmentSize write FBlobSegmentSize;
|
||||||
|
property Dialect : integer read GetDialect;
|
||||||
published
|
published
|
||||||
property Dialect : integer read GetDialect write FDialect;
|
|
||||||
property DatabaseName;
|
property DatabaseName;
|
||||||
property KeepConnection;
|
property KeepConnection;
|
||||||
property LoginPrompt;
|
property LoginPrompt;
|
||||||
@ -133,7 +133,7 @@ type
|
|||||||
|
|
||||||
procedure TIBConnection.CheckError(ProcName : string; Status : PISC_STATUS);
|
procedure TIBConnection.CheckError(ProcName : string; Status : PISC_STATUS);
|
||||||
var
|
var
|
||||||
buf : array [0..1024] of char;
|
buf : array [0..1023] of char;
|
||||||
Msg : string;
|
Msg : string;
|
||||||
E : EIBDatabaseError;
|
E : EIBDatabaseError;
|
||||||
Err : longint;
|
Err : longint;
|
||||||
@ -332,25 +332,28 @@ var
|
|||||||
Buffer : array [0..1] of byte;
|
Buffer : array [0..1] of byte;
|
||||||
ResBuf : array [0..39] of byte;
|
ResBuf : array [0..39] of byte;
|
||||||
begin
|
begin
|
||||||
Buffer[0] := isc_info_db_sql_dialect;
|
if Connected then
|
||||||
Buffer[1] := isc_info_end;
|
begin
|
||||||
if isc_database_info(@FStatus[0], @FSQLDatabaseHandle, Length(Buffer),
|
Buffer[0] := isc_info_db_sql_dialect;
|
||||||
pchar(@Buffer[0]), SizeOf(ResBuf), pchar(@ResBuf[0])) <> 0 then
|
Buffer[1] := isc_info_end;
|
||||||
CheckError('SetDBDialect', FStatus);
|
if isc_database_info(@FStatus[0], @FSQLDatabaseHandle, Length(Buffer),
|
||||||
x := 0;
|
pchar(@Buffer[0]), SizeOf(ResBuf), pchar(@ResBuf[0])) <> 0 then
|
||||||
while x < 40 do
|
CheckError('SetDBDialect', FStatus);
|
||||||
case ResBuf[x] of
|
x := 0;
|
||||||
isc_info_db_sql_dialect :
|
while x < 40 do
|
||||||
begin
|
case ResBuf[x] of
|
||||||
Inc(x);
|
isc_info_db_sql_dialect :
|
||||||
Len := isc_vax_integer(pchar(@ResBuf[x]), 2);
|
begin
|
||||||
Inc(x, 2);
|
Inc(x);
|
||||||
FDialect := isc_vax_integer(pchar(@ResBuf[x]), Len);
|
Len := isc_vax_integer(pchar(@ResBuf[x]), 2);
|
||||||
Inc(x, Len);
|
Inc(x, 2);
|
||||||
end;
|
FDialect := isc_vax_integer(pchar(@ResBuf[x]), Len);
|
||||||
isc_info_end : Break;
|
Inc(x, Len);
|
||||||
else
|
end;
|
||||||
inc(x);
|
isc_info_end : Break;
|
||||||
|
else
|
||||||
|
inc(x);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user