Advertisement

01.20.2008 at 08:09PM PST, ID: 23097434
[x]
Attachment Details

Need to use oRs to get a select value for a combo box

Asked by mathieu_cupryk in Active Server Pages (ASP)

This is the continuation of question:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/ASP/Q_23095904.html?cid=239#a20698760
It is a two part question.

I have the following function

Function FillCboRecordSetAssetTypes(selectName,fieldName)
      dim sCBO
      RecordSetAssetTypes.MoveFirst
      do while not RecordSetAssetTypes.EOF      
            sCBO = sCBO & "<option value='" & RecordSetAssetTypes.Fields(fieldName).Value & "'"
                  IF Request(selectName) = RecordSetAssetTypes.Fields(fieldName).Value Then
                        sCBO = sCBO & " selected='selected'"
                  End If
            sCBO = SCBO & ">" & RecordSetAssetTypes.Fields(fieldName).Value & "</option>"
            RecordSetAssetTypes.MoveNext
      loop
 
      FillCboRecordSetAssetTypes = sCBO
End Function

This populates cboMainCategory perfectly.

  <select id='cboMainCategory' name='cboMainCategory' class='RegularDropDown' style='width:50px;'><%=FillCboRecordSetAssetTypes("cboMainCategory","MACHINE_CATEGORY_ID")%></select>

I need to use the main select of the following stored procedure execution:
Set oStoredProcInterface = New cStoredProcInterface
Set oConn = server.CreateObject("ADODB.Connection"):oConn.Open session("ConnectionString")
redim ParameterArray(5,0)
Call oStoredProcInterface.InsertParamInArray(ParameterArray, "PCCOMPANYID", adChar , adParamInput, 2, "MS")
set oRs = oStoredProcInterface.ExecuteStoredProc (oConn, Application("JTExtrusion20Prefix") & ".PKG_SETTINGS.GETLOOKUPSETTINGS", ParameterArray)

oRs contains the appropriate values.

I need to get oRs.Fields ("MACHINE_DOWNTIME_OPERATION_ID")

and set that in the above fuction. So what I think is this. Pass another value in the function.

and then modify the selected value of the combo box. Can someone help me modify the below function.

I would appreciate it.

Function FillCboRecordSetAssetTypes(selectName,fieldName, oRs.Fields ("MACHINE_DOWNTIME_OPERATION_ID"))

      dim sCBO
      RecordSetAssetTypes.MoveFirst
      do while not RecordSetAssetTypes.EOF      
            sCBO = sCBO & "<option value='" & RecordSetAssetTypes.Fields(fieldName).Value & "'"
                  IF Request(selectName) = RecordSetAssetTypes.Fields(fieldName).Value Then
                        sCBO = sCBO & " selected='selected'"
                  End If
            sCBO = SCBO & ">" & RecordSetAssetTypes.Fields(fieldName).Value & "</option>"
            RecordSetAssetTypes.MoveNext
      loop
 
      FillCboRecordSetAssetTypes = sCBO
End Function



Start Free Trial
 
Keywords: Need to use oRs to get a select value f…
 
Loading Advertisement...
 
[+][-]01.20.2008 at 08:56PM PST, ID: 20703994

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.21.2008 at 06:20PM PST, ID: 20711439

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Sign Up Now!
Solution Provided By: hielo
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628