Use OracleinProcserver to complete the connection and operation of Oracle with OracleinProcserver

xiaoxiao2021-03-06  55

<% Response.charset = "gb2312"

TBLNAME = Request ("tb")

Dim Objorasession, Objoradb

DIM STRDBUSER, STRDBPWD, STRDBCONN

Call connectdb ()

Sub connectionDb () 'connection database

ON Error ResMe next

strDbuser = "liujincai" 'connection username

STRDBPWD = "LJC1001" 'user password

Strdbconn = "hp1" 'connection string

Set Objorasession = Server.createObject ("OracleinProcser.xoRasession")

Set Objoradb = Objorasession.opendatabase (strdbconn, strdbuser & "/" & strdbpwd, 0)

IF err.number> 0 THEN

Response.write "

Error: "& 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 ATABLE_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 = straame

StrtMP = StrtMP & "

"& Stra &"

Else

StrtMP = StrtMP & "

"& Stra &"

END IF

Objrs.movenext

Wend

Set objrs = Nothing

GetTableList = startmp

END FUNCTION

%>

All Tables:

(<% = strDbuser & "/" & strdbpwd & "@" & strdbconn%>)

<% if tblname <> "" "" "" "" & tblname set = objoradb.dbcreateDynaset (strsql, 0) response.write "for i = 0 TO RS.FIELDS.COUNT-1 Response.write "" for i = 0 to rs.fields.count -1 response.write "
" & rs.fields (i) .Name & "" Next Response.write "" While Not Rs.eof Response.write "
" & rs.fields (i) .value & "" Next response.write " "Rs.movenext wend set = nothingend if%> detail Query http://www.jojoo.net/Article/List.asp?id=4101Http://www.cx66.com/cxgzs/program /ASP/581.htmhttp://www.51one.net/info/1797.htmhttp://www.kupage.com/webdesign/7/20031017/1641380000027pjtnjgy.htm

转载请注明原文地址:https://www.9cbs.com/read-113821.html

New Post(0)
CopyRight © 2020 All Rights Reserved
Processed: 0.040, SQL: 9