[問題] ASP中SQL問題出錯

看板Programming作者 (焦ㄚ逃)時間15年前 (2010/03/23 19:12), 編輯推噓2(202)
留言4則, 3人參與, 最新討論串1/1
小弟是剛接觸ASP這塊的新手 最近寫了一個查詢的網頁 程式如下: VideoNo= Request("VideoNo") VideoTitle = Request("VideoTitle") VideoContent = Request("VideoContent") VideoPath = Request("VideoPath") VideoDate = Request("VideoDate") VidoType = Request("VidoType") Search = Request("Search") optionvalue =request("selection") SQL = "Select * from Video where "& optionvalue & " = "& Search rs.open SQL,cn,1,3 執行結果為: 查詢運算式 '=' 中的 語法錯誤 (少了運算元)。 我已經找了許久,但還是找不出錯誤 因此特地來求助,希望板友能幫小弟解答,謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 59.117.143.211

03/23 22:26, , 1F
顯然就是optionvalue或Search有時會缺值啊
03/23 22:26, 1F

03/24 01:06, , 2F
為何不 response.write(sql)
03/24 01:06, 2F

03/24 01:06, , 3F
這樣不就知道字串是否正常了
03/24 01:06, 3F

03/30 23:59, , 4F
response.write 後 response.end
03/30 23:59, 4F
文章代碼(AID): #1BgA8hbQ (Programming)
文章代碼(AID): #1BgA8hbQ (Programming)