下面这段代码能够显示,当前用户所能够看到的所有的用户和表,有兴趣的, 可以把每个表的内容加上
dim objorasession,objoradb
dim strdbuser,strdbpwd,strdbconn
call connectdb()
sub connectdb()
连接数据库
on error resume next
strdbuser = "tmpuser" 连接用户名
strdbpwd = "rt45ps1w" 用户密码
strdbconn = "sun450" 连接字符串
set objorasession = server.createobject("oracleinprocserver.xorasession")
set objoradb = objorasession.opendatabase(strdbconn,strdbuser & "/" & strdbpwd,0)
if err.number>0 then
response.write "错误 :" & err.description & ""
response.end
end if
end sub
sub enddb()
set objoradb = nothing
set objorasession = nothing
end sub
function gettablelist(str)
dim strsql,strtmp
dim objrs
strsql = "select at.table_name as tname,au.username as uname from all_tables at,all_users au where au.username=at.owner order by au.username"
set objrs = objoradb.dbcreatedynaset(strsql,0)
while not objrs.eof
stra = objrs("uname") & "." & objrs("tname")
if str=stra then
strtmp = strtmp & "" & stra & ""
else
strtmp = strtmp & "" & stra & ""
end if
objrs.movenext
wend
set objrs = nothing
gettablelist = strtmp
end function
%>
all tables : () |