' oNNSS is the connection: Set oNNSS = Server.CreateObject("ADODB.Connection") oNNSS.CursorLocation = adUseClient ' connection string is read from globa.asa oNNSS.ConnectionString = Application("NationalNet_ConnectionString") oNNSS.Mode = adModeReadWrite oNNSS.Open '(this is simplified from the original query -- less fields) ' at this point cFrom and cTO are valid dates. ' query returns proper record set (e.g. query is fine) ' but we need to then add country name from another database ' countries (and SRE and other info is already ' copied from a recordset on another DB ' to array aCountries using GetRows() cSQLHist = "select sre, bid, " & _ "CRAmount AS Credit, " & _ "DBAmount AS Debit " & _ "from NSHIST " & _ "where ProcDate between '" & cFrom & "' and '" & cTo & "'" Set oRS = oNNSS.Execute (cSQLHist) If oRS.EOF Then ' message user here ' clean up Response.End end if oRS.Fields.Append "Country",adChar,12 'ERRORError returned on the oRS.Fields.Append line is:
' find country name in array and populate column in report's record set ' basically faking a sql join between two recordsets oRS.MoveFirst() Do While Not oRS.EOF for i = 0 to UBound(aCountries,2) if trim(aCountries(1,i)) = trim(oRS.Fields("SRE").Value) Then oRS.Fields("Country").Value = aCountries(4,i) 'ERROR exit for end if next LoopThe Country value assignment returns "Errors found" w/o specifying the error(s)