Alpha Video Training
Results 1 to 7 of 7

Thread: tbl.fetch_find not working

  1. #1
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,649

    Default tbl.fetch_find not working

    Can anyone explain the following results?

    From the I.E.
    Code:
    tbl = table.open("aex")
    
    tbl.index_primary_put("ITEM")
    
    vItem = "f_A5OnTop"
    
    vRec= tbl.fetch_find(vItem)
    
    ?vRec
    = -1
    
    ?tbl.item
    = f_A5OnTop           
    
    ?tbl.field_get("item").type_get()
    = "C"
    
    ?typeof(vItem)
    = "C"
    
    ?vItem
    = "f_A5OnTop"
    Note tbl.item is NOT returned as a character value.
    ???

  2. #2
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: tbl.fetch_find not working

    This portion

    Code:
    ?tbl.item
    = f_A5OnTop           
    
    ?tbl.field_get("item").type_get()
    = "C"
    is consistent with what you would expect of a memo field "item" if there is something not seen in the returned value.

    Try

    ? len(tbl.item)

    and see what you get.

  3. #3
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,649

    Default Re: tbl.fetch_find not working

    Thanks, Stan. The length is normal (25). But I do have two memo fields. I tried dropping one, then both, but same results. I'll experiment a little more and report back.

  4. #4
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: tbl.fetch_find not working

    For what it is worth. Working with a memo field "item" .

    Code:
    tbl = table.open("test")
    tbl.change_begin()
    tbl.item = "f_A5OnTop"+space(1013)
    tbl.change_end(.t.)
    tbl.close()
    tbl = table.open("test")
    
    ? tbl.item
    = "f_A5OnTop
    ? typeof(tbl.item)
    = "C"
    ? len(TBL.ITEM)
    = 1022.000000
    tbl.close()
    
    tbl = table.open("test")
    tbl.change_begin()
    tbl.item = "f_A5OnTop"+space(1014)
    tbl.change_end(.t.)
    tbl.close()
    tbl = table.open("test")
    
    ? tbl.item
    = f_A5OnTop
    ? typeof(tbl.item)
    = "B"
    ? len(TBL.ITEM)
    = 1023.000000
    tbl.close()

  5. #5
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,649

    Default Re: tbl.fetch_find not working

    Problem resolved: corrupt record or records. After I zapped/packed, it works fine. Luckily I have an import routine to rebuild the records. Oddly, the original records were manually entered by yours truly.

  6. #6
    "Certified" Alphaholic Stan Mathews's Avatar
    Real Name
    Stan Mathews
    Join Date
    Apr 2000
    Location
    Bowling Green, KY
    Posts
    25,119

    Default Re: tbl.fetch_find not working

    ..........the original records were manually entered by yours truly.
    Likely you have pinpointed the source of the problem.

  7. #7
    Volunteer Moderator Peter.Greulich's Avatar
    Real Name
    Peter Greulich
    Join Date
    Apr 2000
    Location
    Boston, MA
    Posts
    11,649

    Default Re: tbl.fetch_find not working

    Quote Originally Posted by Stan Mathews View Post
    Likely you have pinpointed the source of the problem.
    Yeah! The hired help in this office really s**ks!

Similar Threads

  1. Another way to find a record, besides tbl.fetch_find?
    By georgefurnel in forum Alpha Five Version 8
    Replies: 6
    Last Post: 04-20-2008, 06:59 AM
  2. <tbl>.fetch_find() and goto()
    By dik_coleman in forum Alpha Five Version 7
    Replies: 2
    Last Post: 03-24-2006, 01:43 PM
  3. tbl.fetch_find()
    By Zod Mansour in forum Alpha Five Version 6
    Replies: 2
    Last Post: 11-01-2004, 08:10 AM
  4. tbl.fetch_find()
    By Zod Mansour in forum Alpha Five Version 6
    Replies: 3
    Last Post: 10-20-2004, 01:24 PM
  5. WANTED tbl.fetch_find() failure marker
    By Greg Fong in forum Alpha Five Version 4
    Replies: 2
    Last Post: 03-03-2002, 10:03 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •