From: <dav...@us...> - 2010-01-03 01:58:14
|
Revision: 885 http://instantobjects.svn.sourceforge.net/instantobjects/revision/?rev=885&view=rev Author: davidvtaylor Date: 2010-01-03 01:58:02 +0000 (Sun, 03 Jan 2010) Log Message: ----------- * Added experimental support for ZeosDBO v7 Alpha (Enabled using ZEOSDBO_V7+ define) * Added protocol support for Firebird 2.0 and 2.1 including embedded versions Modified Paths: -------------- trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas Modified: trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas =================================================================== --- trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas 2009-12-28 22:53:38 UTC (rev 884) +++ trunk/Source/Brokers/ZeosDBO/InstantZeosDBO.pas 2010-01-03 01:58:02 UTC (rev 885) @@ -36,6 +36,15 @@ {$I '..\..\InstantDefines.inc'} {$ENDIF} +// +// Enable this define for ZeosDBO 7.x Alpha support +// +// WARNING: The broker will no longer compile agaist ZeosDBO v6.6.x. +// Zeos v7 support is experimental and has seen very little testing. +// +{.$DEFINE ZEOSDBO_V7+} + + // Supported databases {$DEFINE SYBASE_SUPPORT} @@ -54,6 +63,13 @@ {$IFDEF D10+}, DBCommonTypes{$ENDIF}; type + // Login event signature changed in v7 Alpha + {$IFDEF ZEOSDBO_V7+} + TZeosLoginEvent = TZLoginEvent; + {$ELSE} + TZeosLoginEvent = TLoginEvent; + {$ENDIF} + TInstantZeosDBOConnectionDef = class(TInstantRelationalConnectionDef) private FCatalog: string; @@ -91,7 +107,7 @@ private FConnection: TZConnection; FLoginPrompt: Boolean; - FOnLogin: TLoginEvent; + FOnLogin: TZeosLoginEvent; FUseDelimitedIdents: Boolean; procedure DoAfterConnectionChange; procedure DoBeforeConnectionChange; @@ -126,7 +142,7 @@ published property Connection: TZConnection read GetConnection write SetConnection; property LoginPrompt: Boolean read GetLoginPrompt write SetLoginPrompt default False; - property OnLogin: TLoginEvent read FOnLogin write FOnLogin; + property OnLogin: TZeosLoginEvent read FOnLogin write FOnLogin; property UseDelimitedIdents: Boolean read FUseDelimitedIdents write SetUseDelimitedIdents default False; end; @@ -485,7 +501,12 @@ if SameText(FConnection.Protocol, 'interbase-5') or SameText(FConnection.Protocol, 'interbase-6') or SameText(FConnection.Protocol, 'firebird-1.0') or - SameText(FConnection.Protocol, 'firebird-1.5') then + SameText(FConnection.Protocol, 'firebird-1.5') or + SameText(FConnection.Protocol, 'firebirdd-1.5') or + SameText(FConnection.Protocol, 'firebird-2.0') or + SameText(FConnection.Protocol, 'firebirdd-2.0') or + SameText(FConnection.Protocol, 'firebird-2.1') or + SameText(FConnection.Protocol, 'firebirdd-2.1') then Result := TInstantZeosDBOIbFbBroker.Create(Self); {$ENDIF} @@ -813,7 +834,11 @@ function TInstantZeosDBOBroker.GetDBMSName: string; begin if Connector.Connected then + {$IFDEF ZEOSDBO_V7+} + Result := Connector.Connection.DbcConnection.GetMetadata.GetDatabaseInfo.GetDatabaseProductName + {$ELSE} Result := Connector.Connection.DbcConnection.GetMetadata.GetDatabaseProductName + {$ENDIF} else Result := Connector.Connection.Protocol; end; @@ -1099,7 +1124,7 @@ DbcConnection.QueryInterface(IZMySqlConnection, MySqlConnection); if Assigned(MySqlConnection) then MySqlConnection.GetPlainDriver. - CreateDatabase(MySqlConnection.GetConnectionHandle, PChar(Database)) + CreateDatabase(MySqlConnection.GetConnectionHandle, PAnsiChar(Database)) else inherited; finally |