Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 23-01-2012
Paulao Paulao is offline
Miembro
 
Registrado: sep 2003
Ubicación: Rua D 31 Casa 1 - Inhoaíba - Rio de Janeiro - RJ - Brasil
Posts: 637
Poder: 21
Paulao Va por buen camino
Problemas con Data Packet

Buenos dias, estoy con un problema asi: Mi aplicacion cria un campo en ejecucion, que llamo de campo customisable. Que pasa es que hay un limite para la cantidad de caracteres(31) y tengo un campo que necesita de 36. Luego, intente cambiar para 60 y no he logrado exito. Exist una variable del tipo TDSDataPacketFldDesc que es declarada en la UNIT DSIntf. En la UNIT Provider hay este comando para garantizar que los caracteres no lo son mas que lo permitido:
Código Delphi [-]
procedure AddFieldDesc(const FldName: string; FldType, Attributes: Integer);
  var
    FldDesc: TDSDataPacketFldDesc;
  begin
    if Length(FldName) >= SizeOf(FldDesc.szFieldName) then
      raise EDSWriter.CreateFmt(SFieldNameTooLong,[SizeOf(FldDesc.szFieldName) - 1]);
    FillChar(FldDesc, SizeOf(FldDesc), 0);
    StrLCopy(FldDesc.szFieldName, PChar(FldName), SizeOf(FldDesc.szFieldName) - 1);
    FldDesc.iFieldType := FldType;
    FldDesc.iAttributes := Attributes;
    Check(FIDSWriter.AddColumnDesc(FldDesc));
  end;
Pero en UNIT DSIntf hay esto:

Código Delphi [-]
MIDASNAME            = packed array [0..31] of Char; { holds a name }
Código Delphi [-]
type
  TPcktAttrArea = (fldAttrArea, pcktAttrArea);
  TPcktFldStatus = (fldIsChanged, fldIsNull, fldIsUnChanged);

  PDSDataPacketFldDesc = ^TDSDataPacketFldDesc;
  TDSDataPacketFldDesc = packed record
    szFieldName: MIDASNAME;           { Column Name }
    iFieldType: Integer;            { Column Type }
    iAttributes: Word;              { Column attributes }
  end;
Mi pregunta es: Como hago para poder permitir que si tenga valores mayores que 32? Ya cambie el Array pa:[0..60] y continua no permitinda nada mayor que 32.
Responder Con Cita
  #2  
Antiguo 25-01-2012
Paulao Paulao is offline
Miembro
 
Registrado: sep 2003
Ubicación: Rua D 31 Casa 1 - Inhoaíba - Rio de Janeiro - RJ - Brasil
Posts: 637
Poder: 21
Paulao Va por buen camino
Señores, hizo asi para ver el resultado, o sea, cambie para un valor fijo(60) y saque la validacion(hizo un comentario) y me lo da el error:

Código Delphi [-]
Field name cannot longer than 31 characters.

procedure AddFieldDesc(const FldName: string; FldType, Attributes: Integer);
  var
    FldDesc: TDSDataPacketFldDesc;
  begin
    if Length(FldName) >=  60{SizeOf(FldDesc.szFieldName)} then
      raise EDSWriter.CreateFmt(SFieldNameTooLong,[SizeOf(FldDesc.szFieldName) - 1]);
    FillChar(FldDesc, SizeOf(FldDesc), 0);
    StrLCopy(FldDesc.szFieldName, PChar(FldName), SizeOf(FldDesc.szFieldName) - 1);
    FldDesc.iFieldType := FldType;
    FldDesc.iAttributes := Attributes;
    Check(FIDSWriter.AddColumnDesc(FldDesc));
  end;
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
clientdataset: Missing dataprovider or data packet Galahad Conexión con bases de datos 5 10-07-2021 02:10:20
Error de Invalid Data Packet Paulao Varios 5 09-09-2011 21:57:22
[Ayuda] Winsock packet _F3R_ Internet 0 22-12-2009 07:31:42
Send Packet rauros Internet 13 30-07-2008 22:15:18
Missing data provider or data packet mcalmanovici Providers 1 11-09-2007 05:55:15


La franja horaria es GMT +2. Ahora son las 01:07:53.


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
Copyright 1996-2007 Club Delphi