Hi Folks - with the transition from VB to the Servoy methods I’m struggling to get even basic (no pun intended) stuff straight in my head.
The basis of a lot of the coding I need to do is copying records from one source Db to another (the main) Db. And some of these data management processes really don’t use a form - other than having some place to put a button to explain and start the process.
For example, to copy a set of records from a flat file table in Db_1 to a Main & Related tables in Db_2 is simple in VB - with the following format:
Open recordset on Db_1 - table_a
Open recordset on Db_2 - table_b
Open recordset on Db_2 - table_c
recordsetDb_1.MoveFirst
Do While… etc
Edit recordsetDb_2_table_b
Add new_record to recordsetDb_2_table_b
… Add fields from Db_1 to equal fields in Db_2
i.e. table_b.column1 = table_a.column1 etc.
Save recordsetDb_2 (to create a PK)
Edit recordsetDb_2_table_c
Add new_record to recordsetDb_2_table_c
…table_c FK = table_b PK
table_b.column10 = table_a.column10 etc
Save recordsetDb_2
recordsetDb_1.MoveNext
Loop etc.
The plethora of methods in Servoy has me struggling to determine the direction I should head in to replicate this kind of functionality? Most of the methods relate to Servoy forms rather than the kind of ‘behind the scenes’ data manipulation we have used in the past.
Q’s
-
Should I be using a FoundSet method for each of these recordsets and if so which foundset-method (getFoundSet)?
-
Can I use a related-recordset to allow single-step input to the main and related tables?
-
Using this kind of coding - will I need to flush the ClientCache, and if so, how will that impact on other clients connected to the same solution?
I’d appreciate some guidance from those ‘old-hand’s’ in Servoy, and some ‘air’ code would be a useful guide to get started.
TIA