--- ibconnection.pp.ori	Tue Aug 09 14:18:46 2011
+++ ibconnection.pp	Wed Aug 17 09:23:14 2011
@@ -381,6 +381,9 @@ procedure TIBConnection.ConnectFB;
 var
   ADatabaseName: String;
   DPB: string;
+{$if defined(cpui386) or defined(cpux86_64)}
+  cw: word;
+{$endif}
 begin
   DPB := chr(isc_dpb_version1);
   if (UserName <> '') then
@@ -397,10 +400,16 @@ begin
   FSQLDatabaseHandle := nil;
   if HostName <> '' then ADatabaseName := HostName+':'+DatabaseName
     else ADatabaseName := DatabaseName;
+{$if defined(cpui386) or defined(cpux86_64)}
+  cw:=get8087cw;
+{$endif}
   if isc_attach_database(@FStatus[0], Length(ADatabaseName), @ADatabaseName[1],
     @FSQLDatabaseHandle,
          Length(DPB), @DPB[1]) <> 0 then
     CheckError('DoInternalConnect', FStatus);
+{$if defined(cpui386) or defined(cpux86_64)}
+  set8087cw(cw);
+{$endif}
 end;
 
 function TIBConnection.GetDialect: integer;
