Re: [問題] ASP連接資料庫問題
※ 引述《Phizek ()》之銘言:
: Set rs1 = Server.CreateObject("ADODB.Recordset")
: If int(Request.QueryString("ID")) > 0 then
: SortSql1 = "Select * From news_detail where number ='"& Request.QueryString("ID")&"'"
: else
: SortSql1 = "Select * From news_detail where number = '001'"
: End if
: rs1.Open SortSql1, CN
: Count1=rs1.RecordCount
: -----------------------------------------------------------------
: 想請問一下RS可以抓到資料
: 為甚麼rs1都抓不到呢
: count1 的值為 -1
: 資料庫確定是有東西的
: 請問一下該如何修改呢
: 謝謝 ^^
我記得recordCount這個資料不是很準確
以前在算的時候都是 select count(*) as Count from news_detail ....
然後再去取count欄位 , 一點經驗啦 .... :P
詳細情形也忘了,我只記得我現在都用這樣的方式取count.
--
▄▅▆▇███▇▆▅▄▃ ╰┼╯─╮ ╮
◥███████████◣ ╰┼╯=│=│
◥██████───────◣ *. ╯ ╯ ╯ の 物 語 .*
◥███████──────◣ ~ ◢◣ ◢◣
◥██████───────◤ ◥◤* 空白的世界.翼 *◥◤
◥██▁▂▃▄▅▆▇███▆▅▄▃▂▂~telnet://tony1223.no-ip.info
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.59.247
討論串 (同標題文章)
Programming 近期熱門文章
PTT數位生活區 即時熱門文章