I have an ASP page that produces a report (HTML table). I want to get a denormalized temporary recordset with all the info for the report.
The data comes from two different dabatases that I collect in two recordsets. The ideal scenario would be to create a join from two recordsets but I don't think that's possible.
What I need in the final report recordset (call it RS2 for this example) is just one column from the first (RS1). A simplified layout is:
RS1 RS2
------ ----
Field1 Field1
Field2 ProcDate
Country Amount
I need Country added to Recordset 2. A simple idea I had is to add spaces as a new field in the query that creates RS2: ...,
' ' AS Country from xxx ...
then copy RS1 to an array and then traverse RS2 and populate Country, replacing the spaces with info found in the SR1 array (or do a Find in SR1 which might be a little slower).
The page fails saying "Errors found" and nothing else on the following line within the loop:
RS1.Fields("Country").Value = RS1.Fields("Country").Value
It does not matter what I put into the field, it always fails on the left side of the equation. The error does not specify anything more. I suspect it is a ReadOnly error but I opened the connection with adReadWrite and I tried all types of adLock parameters.
If I change to:
RS1.Fields("Country").Value = 1
The error changes to a type mismatch, as it should. If not, just says "Errors found". So much for descriptive error messages.
Any ideas? Or any better method to acomplish this?