Okay. All my research so far says not to do this.
http://msgboard.alphasoftware.com/al...t=relation_add
--- But I am going to do it anyway.
I have a desktop program (single user) I use for report purposes.
A5 V10 on Windows XP Pro
I have several clients I run reports for - and ONE that decided to do something different.
My current set links a child (p_vals) to a field in the parent ("Section2->ALL") which has one value ("ALL"). For this one client I must change the link to another field of the parent ("Section2->CAMPUS") which has many values.
After setting all the required relation values, the function relation_change(child_table) return the error message, "The number of arguments or the type of one or more arguments do not match any existing function"
I am attaching a code sample and an image of the link definition from Alpha Five. Any help is appreciated!
dim c_par as C
dim p_st as P
dim p_parent_tbl as P
dim p_parent_index as P
dim p_child_tbl as P
dim p_child_index as P
p_st = set.open_session("Stnd_30") ' Opens all tables in the SET
p_parent_tbl = p_st.section2 ' Assigns pointer to Primary table
p_Child_tbl = p_st.p_vals ' Assigns pointer to Child table
c_par = p_Child_tbl.parent_link_expr_get() ' Gets the current linking field to validate
p_parent_index = p_parent_tbl.index_primary_put() ' Index by recno()
'--- Relational fields to set ---
relation.link_type = LINK_FIRST
p_child_index = p_child_tbl.index_get("CODE") ' Value will either be (litteral) "ALL" or CAMPUS ID
relation.index_child = p_child_index
relation.ref_integrity = 0
relation.order_parent = "ALL" ' Default - Let's get this to work with one value first!
'--- THIS FUNCTION (FAILS)
p_parent_tbl.relation_change(p_Child_tbl)
p_st.close()
http://msgboard.alphasoftware.com/al...t=relation_add
--- But I am going to do it anyway.
I have a desktop program (single user) I use for report purposes.
A5 V10 on Windows XP Pro
I have several clients I run reports for - and ONE that decided to do something different.
My current set links a child (p_vals) to a field in the parent ("Section2->ALL") which has one value ("ALL"). For this one client I must change the link to another field of the parent ("Section2->CAMPUS") which has many values.
After setting all the required relation values, the function relation_change(child_table) return the error message, "The number of arguments or the type of one or more arguments do not match any existing function"
I am attaching a code sample and an image of the link definition from Alpha Five. Any help is appreciated!
dim c_par as C
dim p_st as P
dim p_parent_tbl as P
dim p_parent_index as P
dim p_child_tbl as P
dim p_child_index as P
p_st = set.open_session("Stnd_30") ' Opens all tables in the SET
p_parent_tbl = p_st.section2 ' Assigns pointer to Primary table
p_Child_tbl = p_st.p_vals ' Assigns pointer to Child table
c_par = p_Child_tbl.parent_link_expr_get() ' Gets the current linking field to validate
p_parent_index = p_parent_tbl.index_primary_put() ' Index by recno()
'--- Relational fields to set ---
relation.link_type = LINK_FIRST
p_child_index = p_child_tbl.index_get("CODE") ' Value will either be (litteral) "ALL" or CAMPUS ID
relation.index_child = p_child_index
relation.ref_integrity = 0
relation.order_parent = "ALL" ' Default - Let's get this to work with one value first!
'--- THIS FUNCTION (FAILS)
p_parent_tbl.relation_change(p_Child_tbl)
p_st.close()
Comment