Le todos os registro de uma tabela e monta as opçoes com <INPUT TYPE=radio>
<%
Sub db2radio(Nradio, Tabela, Valor, Nome, Ordenador, Checked)
Set objconex = Server.CreateObject("ADODB.Connection") : objconex.Open strconex
Set RecSet = objconex.execute("SELECT * FROM " & Tabela & " ORDER BY " & Ordenador)
if (Not RecSet.EOF) then
RecSet.MoveFirst
Do While Not RecSet.EOF
If(CSTR(TRIM(UCASE(RecSet.Fields(Valor)))) = CSTR(TRIM(UCASE(Checked)))) then
Response.Write("<INPUT TYPE=radio NAME="& Nradio &" value=" & RecSet.Fields(Valor) & " checked>" & RecSet.Fields(Nome)) & chr(13))
Else
Response.Write("<INPUT TYPE=radio NAME="& Nradio &" value=" & RecSet.Fields(Valor) & ">" & RecSet.Fields(Nome)) & chr(13))
End if
RecSet.MoveNext
Loop
End If
RecSet.Close : Set RecSet = Nothing : objconex.close : Set objconex = Nothing
End Sub
%>
0 comentários:
Postar um comentário