[問題] asp 動態名稱

看板Web_Design作者 (Lancelot)時間16年前 (2010/01/27 15:18), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/2 (看更多)
最近在寫一個隨機選題的網頁 大部分的功能都做好了 但是有一個問題點 就是選題的數量不一定 因此用以下的程式寫 sql = "select * from question where type='A'"(選A類) Set objRS = CN.Execute(sql) Dim aa aa = 1 Do Until objRS.EOF for i=0 to A-1(總共選幾題) if aa = RandomInt(i) then response.Write objRS("ID")& "<br/>" response.write objRS("type")&" " response.write objRS("question")&"<br/>" response.write"<input type='radio' name='typea' value='a'>"&objRS("selecta") response.write"<input type='radio' name='typea' value='b'>"&objRS("selectb") response.write"<input type='radio' name='typea' value='c'>"&objRS("selectc") response.write"<input type='radio' name='typea' value='d'>"&objRS("selectd") response.write"<input type='radio' name='typea' value='e'>"&objRS("selecte")&"<br/>" response.Write"<div><hr /></div>" end if next aa = aa+1 objRS.MoveNext Loop 現在卡在一個點就是因為選的題數不一定 所以name='typea'的地方會有問題 請問各位有什麼辦法可以將這個地方的值設為變數 讓我可以用來傳遞這個值 謝謝 小弟願意送上500元p幣(稅前) -- 當我持球進攻時 可以選擇Lay-up or fade-away         甚至其他的進攻手段來挑戰籃框 然而當我面對妳時    卻不知該怎樣的出手 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 163.17.17.141

01/28 00:41, , 1F
SELECT TOP 題數 * FROM [table] ORDER BY RND(ID)
01/28 00:41, 1F
文章代碼(AID): #1BN-ZBC7 (Web_Design)
文章代碼(AID): #1BN-ZBC7 (Web_Design)