Menu

A mapped field went beyond the end of...

Help
2003-04-22
2003-10-16
  • Erick Sasse

    Erick Sasse - 2003-04-22

    I was using only string fields and everything was ok. Now that I need a DateTime field in my database, I'm getting the error:

    "A mapped field went beyond the end of the physical record structure."

    Everything seems ok for me, I have all fields in the same type and order in both Palm and Delphi.

    I'm using PocketStudio for the PalmOS application.

    Any help will be appreciated.

     
    • Anonymous

      Anonymous - 2003-10-16

      Anyone have any luck with this.

      Same situation

      Tristan

       
      • Paul Gilbert

        Paul Gilbert - 2003-10-16

        The error indicates that the raw data retrieved from a Palm record wasn't enough to satisfy the requirements of your field definitions. As far as I know, there is nothing wrong with the conduit's field handling, so the problem is likely to be in your field definitions.

        A few things to remember:
        - Alignment. This is a feature people sometimes forget. If, for example, you set alignment for every 2 bytes, a single byte field not followed by another byte field then the field will take up two bytes.
        - String handling. Make sure that if the string field is fixed length that you correctly specify the length. Also remember that with alignment on, the following field, if not a string, will be pushed to the next alignment boundary

        One of the best things to do when getting this record is to do some debugging. Set some breakpoints in the RemoteRecordToLocal method and trace through the code as it unpacks the records into the table fields. You can thus quickly figure out if the raw record data isn't precisely matching your field definitions

         
    • Anonymous

      Anonymous - 2003-10-16

      My string length are variable and I have found that using a Date type rather than datetime is ok.

      The field size for a datetype is 2, and from what I can gather a field size for datetime type is 14. Why would the size change for a datetime type?

       
      • Paul Gilbert

        Paul Gilbert - 2003-10-16

        Because they're two completely different types. A Palm DateType represents a date as a 16-bit value with 7 bits for the number of years since 1904, 4 bits for the month number, and 5 bits for the day number.

        A DateTimeType on the other hand stores both a date and time in one structure. It also uses a full 16-bits for the year, so it can handle dates both before 1904 and after 2032, which the DateType can't.

        Check out the Palm OS Reference documentation for more information on the various date/time types.

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.