oracle|程式|連結 以下連結方式是用的ORACLE的專用對像連結方式,移值性不高,但效率挺高的ORACLE專用ODBC 下載
http://otn.oracle.com/software/content.html 需註冊
default.asp
-----------------------------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>資料庫連結</title>
</head>
<body>
<h3 align="left">資料庫連結測試</h3>
<form method="POST" action="connection.asp">
<p>資料庫名稱:<input type="text" name="Database" size="20"></p>
<p>使用者名稱:<input type="text" name="Name" size="20"></p>
<p>使用者密碼:<input type="password" name="Password" size="20"></p>
<p><input type="submit" value="確定"> <input type="reset" value="取消"></p>
</form>
</body>
</html>
connection.asp
-----------------------------------------------------------------------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>資料庫連結結果</title>
</head>
<body>
<p>測試結果如下:</p>
<%
On Error Resume Next
'連結資料庫
Set OraSession = CreateObject("OracleInProcServer.XOraSession")
Set OraDatabase = OraSession.DbOpenDatabase( _
Request("Database"),Request("Name")&"/"&Request("Password"),0)
If Err.Number > 0 Then
'判斷是否發生錯誤
Response.Write "<H4>ASP的錯誤控制</H4>"
Response.Write "ASP 的錯誤來源:" & Err.Source & "<BR>"
Response.Write "ASP 的的錯誤碼:" & Err.Number & "<BR>"
Response.Write "ASP 的的錯誤說明:" & Err.Description & "<BR>"
Err.Clear
Response.Write "<H4>Oracle OLE 的錯誤控制</H4>"
Response.write "Oracle OLE的錯誤碼:" & OraSession.LastServerErr &"<BR>"
Response.write "Oracle OLE的錯誤說明:" & OraSession.LastServerErrText &"<BR>"
else
Response.write "<center><H3>資料庫成功連結</center>"
'關閉資料庫
OraDatabase.Close
'Free Session物件
Set OraSession = nothing
End If
%>
</body>
</html>