Hi
I have an error message when I run this script. I am not able to figure out what cause this error message.
and attached the error message.
Thank you.
I have an error message when I run this script. I am not able to figure out what cause this error message.
Code:
FUNCTION Workodr_Saveto_day AS C ( ) t = table.open("ws_daily",FILE_RW_EXCLUSIVE) t.zap(.t.) 'clean current records t.close() 'Oepn WorkOdr and get some of infor to Variable dim tWrkOdr as p dim vWrkodrId as c dim vEmpId as c dim vJobId as c dim vAssign as c dim vStart as d dim vDuration as n dim vDate as d tWrkOdr = table.open("wrkodr_hd",FILE_RO_SHARED) tWrkOdr.fetch_first() while .not. tWrkOdr.fetch_eof() vWrkodrId = tWrkOdr.Wrkodr_id vJobId = tWrkOdr.Project_id vAssign = alltrim(tWrkOdr.Assignment) vStart = tWrkOdr.Plan_startdate vDuration = tWrkOdr.Plan_duration 'Save it to WrkOdr_daily table in order to make daily and weekly schedule until end 'Figure out the Date for i = 1 to vDuration vDate = add_bus_days(vStart-1,i) 'Searhing the Emp here? 'Find the Emp_id form WrkOdr_assign table by WrkOdr_id dim tWrkAssn as p dim qWrkAssn as p dim rWrkAssn as n tWrkAssn = table.open("WrkOdr_assign",FILE_RO_SHARED) query.filter = "wrkodr_id="+quote(vWrkodrId) query.order ="wrkodr_id" qWrkAssn = tWrkAssn.query_create() rWrkAssn = qWrkAssn.records_get() tWrkAssn.fetch_first() while .not. tWrkAssn.fetch_eof() vEmpId= tWrkAssn.Emp_id 'ui_msg_box("No of Emp",vEmpId) 'Just see how many records? 'Save it to WrkOdr_daily table dim tWsDaily as p tWsDaily = table.open("WS_daily",FILE_RW_SHARED) tWsDaily.enter_begin() tWsDaily.Assign_date = vDate tWsDaily.Wrkodr_id = vWrkodrId tWsDaily.Emp_id = vEmpId tWsDaily.Assignment = vAssign tWsDaily.Project_id = vJobId tWsDaily.Day = dow(vDate) tWsDaily.Week = week(vDate) tWsDaily.Month = month(vDate) tWsDaily.Year = year(vDate) tWsDaily.enter_end(.t.) tWrkAssn.fetch_next() end while next i 'end tWrkOdr.fetch_next() end while tWrkAssn.close() tWrkOdr.close() tWsDaily.close() END FUNCTION
Thank you.
Comment