Hello everyone,
I'm trying to populate a dropdown list using the GetRows:
varSQL = "SELECT * FROM dbTable"
Set dbReponse = Server.CreateObject("ADODB.Recordset"
dbReponse.Open varSQL, dbLink
lingAbTab = dbReponse.GetRows()
<select size="1" name="readEn">
<option value="0" selected>-</option>
<%
For iRowLoop = 0 to UBound(lingAbTab, 2)
For iColLoop = 0 to UBound(lingAbTab, 1)
if (iColLoop = 0) then
aff = "<option value=" & lingAbTab(iColLoop, iRowLoop) & ">"
Else if (iColLoop = 1) then
aff = aff & lingAbTab(iColLoop, iRowLoop) & "</option>"
End if
Next
Response.Write(aff)
Next
%>
</select>
The result should be:
1- yes
2- no
3- maybe
etc.
The error I get is: Unexpected 'Next' (After the End If)
Can someone help me?
Thanks
I'm trying to populate a dropdown list using the GetRows:
varSQL = "SELECT * FROM dbTable"
Set dbReponse = Server.CreateObject("ADODB.Recordset"
dbReponse.Open varSQL, dbLink
lingAbTab = dbReponse.GetRows()
<select size="1" name="readEn">
<option value="0" selected>-</option>
<%
For iRowLoop = 0 to UBound(lingAbTab, 2)
For iColLoop = 0 to UBound(lingAbTab, 1)
if (iColLoop = 0) then
aff = "<option value=" & lingAbTab(iColLoop, iRowLoop) & ">"
Else if (iColLoop = 1) then
aff = aff & lingAbTab(iColLoop, iRowLoop) & "</option>"
End if
Next
Response.Write(aff)
Next
%>
</select>
The result should be:
1- yes
2- no
3- maybe
etc.
The error I get is: Unexpected 'Next' (After the End If)
Can someone help me?
Thanks