ASP獲取值某個表裡面的欄位

時間 2022-10-29 20:40:03

1樓:匿名使用者

這樣寫:

<%dim usertype

dim sql

sql="select * from reguser"

rs.open sql,conn,3

if not rs.eof then

usertype=rs("usertype")end if

if(usertype="醫院") then%>

釋出新資訊

<%else%>

釋出新資訊

<%end if%>

在使用rs.open sql,conn,3這個語句之前必須先開啟資料庫連線,並建立recordset物件

2樓:

rs=createobject("adodb.recordset")str="select * from reguser"

rs.open str,conn,1,1

session("usertype")=rs("usertype")就這樣賦值

3樓:匿名使用者

<%else%>

釋出新資訊

<%end if%>

4樓:

session(property)=value

是什麼dbms(例如sql,access,oracle)?還有reguser是表名,usertype是欄位嗎?

5樓:meome繪畫

沒說清楚嘛~ 再說清楚些

照你說的就是 讀取資料表中的那個usertype 值 然後賦給session("usertype")

asp如何獲取另面的文字返回值,asp如何獲取另一頁面的文字返回值?

其實很簡單 a request action if a x then response.write 成功 if a zzz then response.write 不成功 酒瓶裡的蚊子 用於編碼轉換的函式 function bytestobstr body,cset set objstream se...

用ASP如何得到表數,用ASP如何得到表數

if i mod 5 0 then response.write end if next response.write response.write next end function end class zjutsxj 的回答是正確的,不可能用一個select 得到表的數量的 但是它的 有很多別的...

請問高手些這個asp函式怎麼獲取

vbscript 如果是一個字串,那麼就用 datestr 2009年7月2日 year left datestr 4 返回2009 如果你是想獲取當前的時間日期裡的 年 year year now 返回2009 datestr 2009年7月2日 year datestr.substr 0,4 返...