Guest DiegoBellini Report post Posted 02/23/2012 10:34 PM How do I create an array with RvSet, just as the results returned by the database query module.($RV[ModuleTitle_ColumnIndex_RowIndex]) I have a VBS module with a query that returns multiple data. I want to build a type RVSet like $RV[Name_ColumnIndex_RowIndex) Look at mi example: set vg = CreateObject("vgServices.CommandLink") set cn = CreateObject("ADODB.Connection") set rs = CreateObject("ADODB.Recordset") cn.Open "$RV[ConnStr]" if cn.State <> 1 then vg.Admin_TraceLogAdd iLineId, 5, "login LeadingAd connection to database could not be made" vg.Run_ResultReturn iLineId, "fail" WScript.Quit end if set rs.ActiveConnection = cn sSQL = "SELECT CurrentBal, NumCard from TBLBalanceMast WHERE SocioNum = " & $RV[GetCustId] rs.Open sSQL, cn, 3 if rs.RecordCount <= 0 then rs.Close vg.Admin_TraceLogAdd iLineId, 5, "no records retrieved" else Balance = rs.Fields("CurrentBal").Value Number = rs.Fields("NumCard").Value ' vg.RvSet $RV_LINEID, "Balances",Balance ' vg.RvSet $RV_LINEID, "Numeros",Number rs.Close end if cn.Close set rs = Nothing set cn = Nothing set vg = Nothing WScript.Quit The query works fine, but do not know how I RvSet to assemble several variables indexed like database query module. Thanks, Diego Bellini Share this post Link to post
SupportTeam Report post Posted 02/23/2012 11:01 PM change: if rs.RecordCount <= 0 then rs.Close vg.Admin_TraceLogAdd iLineId, 5, "no records retrieved" else Balance = rs.Fields("CurrentBal").Value Number = rs.Fields("NumCard").Value ' vg.RvSet $RV_LINEID, "Balances",Balance ' vg.RvSet $RV_LINEID, "Numeros",Number rs.Close end if to: if rs.RecordCount <= 0 then rs.Close vg.Admin_TraceLogAdd iLineId, 5, "no records retrieved" else recordcount = rs.RecordCount rs.MoveFirst for i = 1 to recordcount Balance = rs.Fields("CurrentBal").Value Number = rs.Fields("NumCard").Value vg.RvSet $RV_LINEID, "MyDatasetName_1_" & i, Balance vg.RvSet $RV_LINEID, "MyDatasetName_2_" & i", Number if i < recordcount then rs.MoveNext end if next rs.Close end if This way the RVs are created in the $RV[Name_ColumnIndex_RowIndex] format. Share this post Link to post