Solution to the connection problem between ORACLE920 and ASP

Source: Internet
Author: User
Tags error code error handling oracle database
Solution to the connection problem between ORACLE920 and ASP

The code is as follows:
<%
On error resume next
'Connect to the database

Set OraSession = CreateObject ("OracleInProcServer. XOraSession ")
Set oradatabase = orasession. dbopendatabase ("database name", "user name/password", 0)

'Error handling
If err. number> 0 then
Response. Write "Response. Write "asp error Source:" & err. Source & "<br>"
Response. Write "asp error code:" & err. number & "<br>"
Response. Write "asp error Description:" & err. Description & "<br>"
Err. Clear
Response. Write "Response. Write "ORACLE error code" & OraSession. lastServerErr & "<br>"
Response. Write "ORACLE error description" & OraSession. lastServerErrtext & "<br>"
CloseDatabase
Displayerror
Response. end
End if

'Close the database
Sub closeDatabase ()
Oradatabase. close
'Set oradatabase = nothing
Orasession. close
Set orasession = nothing
End sub

Function displayerror ()
If err. number <> 0 then
Response. Write "<br> <p align = center fontsize = 20> database connection failed. Contact the system administrator! </P>"
Response. End
End if
End function

%>

Solution:

1. When IIS accesses the ORACLE database, it assigns a permission (oracle bug) to OLEDB)
Add/edit the "Authenticated Users" user in the attributes of the ORA92 directory under the ORACLE_HOME Directory. Click "Read and run" first, and then click "select, then "application ".

2. There is a "sqlnet. ora" file in the ORA92etworkADMIN directory under the ORACLE_HOME directory,
The content is as follows:

# SQLNET. ORA Network Configuration File: E: oracleora92etworkadminsqlnet. ora
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.