Alpha Video Training
Results 1 to 3 of 3

Thread: <tbl>.fetch_find

  1. #1
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default <tbl>.fetch_find

    Hi all,

    I have the Index, "Project_id" and Include is "all" in the table.

    If I use the Query Method (my test line 3) then I can find the records but
    when I tried to use the <tbl>.fetch_find() method, I cannot find the records on below scripts

    Does anyone know why did not work with <tbl>.fetch_find() method?
    Code:
    debug(1)
    dim vProjectId as c = "10-0050"
    dim vIsprint as c =""
    dim tbl as p
    tbl = table.open("insur_logs",FILE_RO_SHARED)
    '******** Test Index method 1 **********
    tbl.index_primary_put("Project_Id")
    rcd = tbl.fetch_find(vProjectId)
    
    '******** Test Index method 2 **********
    'tbl.order("project_id")
    'rcd = tbl.fetch_find(vProjectId)
    
    '***** Test for Query Method ********
    'query.order=""
    'query.filter="project_id="+quote(vProjectId)
    'qry = tbl.query_create()
    'rcd = qry.records_get()
    
    if rcd>0 then
    	'tbl.order("log_date")
    	tbl.fetch_last()
    	vIsprint = tbl.Isprinted
    	ui_msg_box("test","Is Print - Record is "+vIsprint)
    else
    	ui_msg_box("test2","Is Print - No found Error ")	
    end if
    'qry.drop()	
    tbl.close()

  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

    I see nothing wrong with your code, would have to have a table sample to investigate further.

    This worked in AlphaSports. (changed only what I had to to use a different table)

    Code:
    dim vProjectId as c = "00000025" 'valid customer_id
    dim vIsprint as c =""
    dim tbl as p
    tbl = table.open("customer",FILE_RO_SHARED) 'changed table name
    '******** Test Index method 1 **********
    tbl.index_primary_put("Customer_0") 'changed index tag
    rcd = tbl.fetch_find(vProjectId)
    
    '******** Test Index method 2 **********
    'tbl.order("project_id")
    'rcd = tbl.fetch_find(vProjectId)
    
    '***** Test for Query Method ********
    'query.order=""
    'query.filter="project_id="+quote(vProjectId)
    'qry = tbl.query_create()
    'rcd = qry.records_get()
    
    if rcd>0 then
    	'tbl.order("log_date")
    '	tbl.fetch_last()
    '	vIsprint = tbl.Isprinted
    	vIsprint = tbl.lastname
    	ui_msg_box("test","Is Print - Record is "+vIsprint)
    else
    	ui_msg_box("test2","Is Print - No found Error ")	
    end if
    'qry.drop()	
    tbl.close()
    Last edited by Stan Mathews; 10-24-2011 at 05:38 PM.

  3. #3
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: <tbl>.fetch_find

    Stan,

    Thank you. After run Register Cleaner, It works well.

Similar Threads

  1. tbl.fetch_find not working
    By Peter.Greulich in forum Alpha Five Version 8
    Replies: 6
    Last Post: 07-23-2008, 04:02 PM
  2. 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
  3. <tbl>.fetch_find() and goto()
    By dik_coleman in forum Alpha Five Version 7
    Replies: 2
    Last Post: 03-24-2006, 01:43 PM
  4. tbl.fetch_find()
    By Zod Mansour in forum Alpha Five Version 6
    Replies: 2
    Last Post: 11-01-2004, 08:10 AM
  5. tbl.fetch_find()
    By Zod Mansour in forum Alpha Five Version 6
    Replies: 3
    Last Post: 10-20-2004, 01:24 PM

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
  •