Combining datasets
One of the pages that I’m developing required a rather large query. Since I’m using MS Access as my database I’m limited to the number of characters in the query ( I believe it’s 256.). So I broke the query apart by the UNIONs that I did with the thought I could combine the datasets after each one. Well I learned something new. I tried:
For each dr in ds2.tables(0).rows
Ds.tables(0).rows(0).add(dr)
Next
But this threw an error that the row already existed. I’m not sure of the mechanics of the datasets but to me this made sense. I did learn that the following works
For each dr in dt.rows
Ds.tables(0).importrow(dr)
Next
By assigning the ds2.tables(0) to dt this now worked. So the disassociation of the datatable from the two dataset seems to allow the add to work.
If you know the why’s of above let me know but if you just needed it to work then happy coding!

<< Home