ASP Link Oracle Program

Source: Internet
Author: User
Tags error code ole
Oracle| Program | Links The following links are used by the Oracle dedicated to the image link, the value is not high, but very efficient Oracle dedicated ODBC download

Http://otn.oracle.com/software/content.html need to register

Default.asp

-----------------------------------------------------------------


<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<title> Database Links </title>

<body>


<form method= "POST" action= "connection.asp" >
<p> database name: <input type= "text" name= "database" size= "></p>"
<p> User name: <input type= "text" name= "name" size= "></p>
<p> user password: <input type= "password" name= "password" size= "></p>"
<p><input type= "Submit" value= "OK" > <input type= "reset" value= "Cancel" ></p>
</form>
</body>

Connection.asp

-----------------------------------------------------------------------------


<meta http-equiv= "Content-type" content= "text/html; Charset=big5 ">
<title> Database Link Results </title>

<body>

<p> test results are as follows:</p>
<%
On Error Resume Next

' Link Database
Set orasession = CreateObject ("Oracleinprocserver.xorasession")
Set Oradatabase = Orasession.dbopendatabase (_
Request ("Database"), Request ("Name") & "/" &request ("Password"), 0)

If err.number > 0 Then

' Determine if there is an error
Response.Write "Response.Write "ASP Error Source:" & Err.Source & "<BR>"
Response.Write "ASP's error code:" & Err.Number & "<BR>"
Response.Write "ASP's error Description:" & Err.Description & "<BR>"
Err.Clear

Response.Write "Response.Write "Oracle OLE error code:" & Orasession.lastservererr & "<BR>"
Response.Write "Oracle OLE error Description:" & Orasession.lastservererrtext & "<BR>"
Else
Response.Write "<center><H3> Database successful link </center>"

' Close the Repository
Oradatabase.close

' Free Session Object
Set orasession = Nothing
End If
%>
</body>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.