Beefs:
When I perform an Append Operation, it returns a message box that states how many records were appended, etc. I wish it would work silently, but I can't find a way to do this.
The user doesn't see any progress taking place(other than the very small record number change on the status bar), and also this operation takes a while (about 50,000 records).
'============================================
Because I need to append 5 different tables, I decided to do this in xBasic.
I started the Script Recorder and ran the Append Operation. When completed, I copied the commands to a script. Since the first line in the Script Recorder assumes the current table:
e.g. a_tbl = table current()
I added: a_tbl = table.open("arcSold2.dbf") to assure this would be the current table (I left out the file path out for this example)
This is the script:
a_tbl = table.open("arcSold2.dbf") ' no path in this example
a_tbl = table.current()
append.t_db = "sold2.dbf" ' no path
append.m_key = "SALE_NO"
append.t_key = "SALE_NO"
append.m_filter = ".T."
append.t_filter = "SALE_NOASKN_WHICH_SALES_NUMBER"
append.type = "Unique only"
append.m_count = 13
append.m_field1 = "SALE_NO"
append.m_exp1 = "@SOLD2->SALE_NO"
append.m_field2 = "PART_NO"
append.m_exp2 = "@SOLD2->PART_NO"
append.m_field3 = "DISC"
append.m_exp3 = "@SOLD2->DISC"
append.m_field4 = "SELL_PRICE"
append.m_exp4 = "@SOLD2->SELL_PRICE"
append.m_field5 = "QTY_SOLD"
append.m_exp5 = "@SOLD2->QTY_SOLD"
append.m_field6 = "TOTAL_COST"
append.m_exp6 = "@SOLD2->TOTAL_COST"
append.m_field7 = "TAXABLE"
append.m_exp7 = "@SOLD2->TAXABLE"
append.m_field8 = "TAX"
append.m_exp8 = "@SOLD2->TAX"
append.m_field9 = "PART_RATE"
append.m_exp9 = "@SOLD2->PART_RATE"
append.m_field10 = "CATEGORY"
append.m_exp10 = "@SOLD2->CATEGORY"
append.m_field11 = "PRICE_PAID"
append.m_exp11 = "@SOLD2->PRICE_PAID"
append.m_field12 = "SALEMESSNO"
append.m_exp12 = "@SOLD2->SALEMESSNO"
append.m_field13 = "PART_NO_2"
append.m_exp13 = "@SOLD2->PART_NO_2"
append.t_count = 0
a_tbl.append()
'===============================================
I created the archive table (arcSold2) by copying it from the Sold2 table and emptying it, so the format etc, would be exactly the same. There are 13 fields, the same as above, as I wanted to copy all the information.
While the Append operation runs fine....The script won't.
The error that I get is:
a_tbl.append()
Variable append.m_key references a non-existant field SALE_NO
I checked and both tables have this field and they are identical.
Is the Script Recorder leaving out something important? I've looked at the .append() command and I can't see where I could improve the above statements.
Any help would be appreciated,
--Bob
When I perform an Append Operation, it returns a message box that states how many records were appended, etc. I wish it would work silently, but I can't find a way to do this.
The user doesn't see any progress taking place(other than the very small record number change on the status bar), and also this operation takes a while (about 50,000 records).
'============================================
Because I need to append 5 different tables, I decided to do this in xBasic.
I started the Script Recorder and ran the Append Operation. When completed, I copied the commands to a script. Since the first line in the Script Recorder assumes the current table:
e.g. a_tbl = table current()
I added: a_tbl = table.open("arcSold2.dbf") to assure this would be the current table (I left out the file path out for this example)
This is the script:
a_tbl = table.open("arcSold2.dbf") ' no path in this example
a_tbl = table.current()
append.t_db = "sold2.dbf" ' no path
append.m_key = "SALE_NO"
append.t_key = "SALE_NO"
append.m_filter = ".T."
append.t_filter = "SALE_NOASKN_WHICH_SALES_NUMBER"
append.type = "Unique only"
append.m_count = 13
append.m_field1 = "SALE_NO"
append.m_exp1 = "@SOLD2->SALE_NO"
append.m_field2 = "PART_NO"
append.m_exp2 = "@SOLD2->PART_NO"
append.m_field3 = "DISC"
append.m_exp3 = "@SOLD2->DISC"
append.m_field4 = "SELL_PRICE"
append.m_exp4 = "@SOLD2->SELL_PRICE"
append.m_field5 = "QTY_SOLD"
append.m_exp5 = "@SOLD2->QTY_SOLD"
append.m_field6 = "TOTAL_COST"
append.m_exp6 = "@SOLD2->TOTAL_COST"
append.m_field7 = "TAXABLE"
append.m_exp7 = "@SOLD2->TAXABLE"
append.m_field8 = "TAX"
append.m_exp8 = "@SOLD2->TAX"
append.m_field9 = "PART_RATE"
append.m_exp9 = "@SOLD2->PART_RATE"
append.m_field10 = "CATEGORY"
append.m_exp10 = "@SOLD2->CATEGORY"
append.m_field11 = "PRICE_PAID"
append.m_exp11 = "@SOLD2->PRICE_PAID"
append.m_field12 = "SALEMESSNO"
append.m_exp12 = "@SOLD2->SALEMESSNO"
append.m_field13 = "PART_NO_2"
append.m_exp13 = "@SOLD2->PART_NO_2"
append.t_count = 0
a_tbl.append()
'===============================================
I created the archive table (arcSold2) by copying it from the Sold2 table and emptying it, so the format etc, would be exactly the same. There are 13 fields, the same as above, as I wanted to copy all the information.
While the Append operation runs fine....The script won't.
The error that I get is:
a_tbl.append()
Variable append.m_key references a non-existant field SALE_NO
I checked and both tables have this field and they are identical.
Is the Script Recorder leaving out something important? I've looked at the .append() command and I can't see where I could improve the above statements.
Any help would be appreciated,
--Bob
Comment