Hi
there are 2 active link tables boith are the same definition. members & oldmembers. I am trying to archive from the live system, so i decided to try using an append function ( see the generated xbasic at the bottom of this mail). my master is oldmembers and the trancastion is members.
from the members form I have a button that calls the append operation, and i set the conditon on the button to bee record, ie where number on the form = to number in the members. this all runs fun alpha 5 sees there is one record to append etc, once then I get this rerror return: Error running Append operation, variabler append.m_exp1 expression-field is not regonised.
Maybe i should do it differently? if so how? Still new to this so sorry to be a pain.
TIA.
Florian
Florian
DIM Append as P
a_tbl = table.open("oldmembersql")
append.t_db = "membersql"
ON ERROR GOTO ERROR0906200910032281
append.m_key = ""
append.t_key = ""
append.m_filter = ""
append.t_filter = ""
append.type = "All"
append.m_count = 4
append.m_field1 = "Number"
append.m_exp1 = "Membersql->Number"
append.m_field2 = "Surname"
append.m_exp2 = "Membersql->Surname"
append.m_field3 = "Initials"
append.m_exp3 = "Membersql->Initials"
append.m_field4 = "Firstname"
append.m_exp4 = "Membersql->Firstname"
append.t_count = 0
'Prompt for confirmation before running the Operation.......
dim rec_count as n
Dim OpDenf as P
if eval_valid("arguments") = .f. then
dim arguments as sql::arguments
else
if typeof(arguments) = "Z" then
delete arguments
dim arguments as sql::arguments
end if
end if
OpDefn.arguments = arguments
rec_count = a5_get_records_in_query("membersql",append.t_filter,-1,.f.,OpDefn)
message_text = "A maximum of "+rec_count + " record(s) will be appended from 'membersql', to 'oldmembersql'. "+crlf(2)+ "OK to proceed?"
operation_result=ui_msg_box("Append Operation",message_text,UI_OK_CANCEL+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
If operation_result <> ui_ok_selected then
end
end if
a_tbl.append()
GOTO CONTINUE0906200910032281
ERROR0906200910032281:
ON ERROR GOTO 0
ui_msg_box("Error","Error running Append Operation"+crlf()+error_text_get())
END
CONTINUE0906200910032281:
a_tbl.close()
'Display a dialog box showing the results of the Operation
dim args as sql::arguments
if eval_valid("arguments") then
if typeof(arguments) = "P" then
args = arguments
end if
end if
a5_append_op_result(a_records_processed,a_records_total,a_records_violated, "oldmembersql","Append Operation Result",args)
'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
there are 2 active link tables boith are the same definition. members & oldmembers. I am trying to archive from the live system, so i decided to try using an append function ( see the generated xbasic at the bottom of this mail). my master is oldmembers and the trancastion is members.
from the members form I have a button that calls the append operation, and i set the conditon on the button to bee record, ie where number on the form = to number in the members. this all runs fun alpha 5 sees there is one record to append etc, once then I get this rerror return: Error running Append operation, variabler append.m_exp1 expression-field is not regonised.
Maybe i should do it differently? if so how? Still new to this so sorry to be a pain.
TIA.
Florian
Florian
DIM Append as P
a_tbl = table.open("oldmembersql")
append.t_db = "membersql"
ON ERROR GOTO ERROR0906200910032281
append.m_key = ""
append.t_key = ""
append.m_filter = ""
append.t_filter = ""
append.type = "All"
append.m_count = 4
append.m_field1 = "Number"
append.m_exp1 = "Membersql->Number"
append.m_field2 = "Surname"
append.m_exp2 = "Membersql->Surname"
append.m_field3 = "Initials"
append.m_exp3 = "Membersql->Initials"
append.m_field4 = "Firstname"
append.m_exp4 = "Membersql->Firstname"
append.t_count = 0
'Prompt for confirmation before running the Operation.......
dim rec_count as n
Dim OpDenf as P
if eval_valid("arguments") = .f. then
dim arguments as sql::arguments
else
if typeof(arguments) = "Z" then
delete arguments
dim arguments as sql::arguments
end if
end if
OpDefn.arguments = arguments
rec_count = a5_get_records_in_query("membersql",append.t_filter,-1,.f.,OpDefn)
message_text = "A maximum of "+rec_count + " record(s) will be appended from 'membersql', to 'oldmembersql'. "+crlf(2)+ "OK to proceed?"
operation_result=ui_msg_box("Append Operation",message_text,UI_OK_CANCEL+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
If operation_result <> ui_ok_selected then
end
end if
a_tbl.append()
GOTO CONTINUE0906200910032281
ERROR0906200910032281:
ON ERROR GOTO 0
ui_msg_box("Error","Error running Append Operation"+crlf()+error_text_get())
END
CONTINUE0906200910032281:
a_tbl.close()
'Display a dialog box showing the results of the Operation
dim args as sql::arguments
if eval_valid("arguments") then
if typeof(arguments) = "P" then
args = arguments
end if
end if
a5_append_op_result(a_records_processed,a_records_total,a_records_violated, "oldmembersql","Append Operation Result",args)
'If the Operation is run from within a Form or Browse, then refresh the window
if is_object(topparent.this) then
if topparent.Class() = "form" .or. topparent.class() = "browse" then
topparent.Refresh_layout()
end if
end if
Comment