Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Conexión con bases de datos (https://www.clubdelphi.com/foros/forumdisplay.php?f=2)
-   -   Problema al relacionar dos tablas (https://www.clubdelphi.com/foros/showthread.php?t=9594)

asegurpe 27-04-2004 17:30:30

Problema al relacionar dos tablas
 
Hola,

Necesito relacionar dos tablas mediante las propiedades MasterSource y MasterField, el problema esta que en cuanto activo la tabla aparece el siguiente error:

Could not convert variant of type (Null) into type (String)


Los dos campos son numericos.

Estoy utilizando el componente THalcyonDataSet en Delphi 7.


De antemano, gracias.

asegurpe 28-04-2004 16:27:45

Problema resuelto
 
Muy buenas,


Ya he podido resolver el problema.

Para resolverlo lo he hecho de una manera muy bruta, que es modificar directamente el codigo del Halcyon.

Del fichero gs6_DBF he modificado lo marcado como negrita.

Código:


 
Procedure GSO_dBaseFld.gsStuffABuffer(Buffer: PChar; const KeyFields: string; const KeyValues: Variant);
var
  Psn: integer;
  Ctr: integer;
  cf: string;
  cv: string;
  tsl: TStringList;
begin
  CurRecord := pointer(Buffer);
  gsBlank;
  if length(KeyFields) > 0 then
  begin
          tsl := TStringList.Create;
          Psn := 1;
          while Psn < length(KeyFields) do
          begin
                cf := gsExtractFieldName(KeyFields,Psn);
                tsl.Add(cf);
          end;
          if tsl.Count = 1 then
          begin
                if ((VarIsStr(KeyValues)) and (KeyValues <> '')) or (IntToStr(KeyValues) <> '') then
                        cv := KeyValues
                else
                        cv := '';
                gsStringPut(tsl[0],cv);
          end
          else
          begin
                for Ctr := 0 to tsl.Count-1 do
                begin
                        if KeyValues[Ctr] <> '' then
                          cv := KeyValues
                        else
                          cv := '';
                        gsStringPut(tsl[Ctr],cv);
                end;
          end;
          tsl.Free;
  end;
  CurRecord := CurRecHold;
end;

Salutaciones,
Asegurpe


La franja horaria es GMT +2. Ahora son las 03:42:48.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi