VBScript Help: Create recordset and loop to fetch values:
<script language="VBScript">
'======================
' Function - FetchSubscriberName
'======================
Function FetchSubscriberName
strSQL = ""
strSQL = strSQL & "SELECT distinct sub_name as sub_name FROM testsubscription
Set recsetApp = RunSQL(strSQL)
With recsetApp
Do While Not recsetApp.EOF
msgbox recsetApp.Fields("sub_name").Value
recsetApp.MoveNext
Loop
End with
End Function
</script>
VBScript Help: Create recordset and fill to a combox box
<script language="VBScript">
'======================
' Function - FetchSubscriberName
'======================
Function FetchSubscriberName
strSQL = ""
strSQL = strSQL & "SELECT distinct sub_name as sub_name FROM testsubscription where event_name = '" & combobox2.value & "'"
Set recsetApp = RunSQL(strSQL)
With recsetApp
Set oDD = document.getelementbyID("Subname")
Do While Not recsetApp.EOF
Set oOpt = oDD.document.createElement("option")
oOpt.Text = recsetApp.Fields("sub_name").Value
oOpt.Value = oOpt.Text
oDD.Options.Add oOpt
'msgbox recsetApp.Fields("sub_name").Value
recsetApp.MoveNext
Loop
End with
End Function
</script>
<script language="VBScript">
'======================
' Function - FetchSubscriberName
'======================
Function FetchSubscriberName
strSQL = ""
strSQL = strSQL & "SELECT distinct sub_name as sub_name FROM testsubscription
Set recsetApp = RunSQL(strSQL)
With recsetApp
Do While Not recsetApp.EOF
msgbox recsetApp.Fields("sub_name").Value
recsetApp.MoveNext
Loop
End with
End Function
</script>
VBScript Help: Create recordset and fill to a combox box
<script language="VBScript">
'======================
' Function - FetchSubscriberName
'======================
Function FetchSubscriberName
strSQL = ""
strSQL = strSQL & "SELECT distinct sub_name as sub_name FROM testsubscription where event_name = '" & combobox2.value & "'"
Set recsetApp = RunSQL(strSQL)
With recsetApp
Set oDD = document.getelementbyID("Subname")
Do While Not recsetApp.EOF
Set oOpt = oDD.document.createElement("option")
oOpt.Text = recsetApp.Fields("sub_name").Value
oOpt.Value = oOpt.Text
oDD.Options.Add oOpt
'msgbox recsetApp.Fields("sub_name").Value
recsetApp.MoveNext
Loop
End with
End Function
</script>
No comments:
Post a Comment