" Response.Write "asp 错误代码:"&err.number &"
" Response.Write "asp 错误说明:"&err.Description &"
" err.Clear Response.Write "ORACLE OLE 错误控制" Response.Write "ORACLE 错误代码"&OraSession.lastServerErr&"
" Response.Write "ORACLE 错误说明"&OraSession.lastServerErrtext&"
" closeDatabase displayerror Response.end end if '关闭数据库 sub closeDatabase() oradatabase.close 'set oradatabase=nothing orasession.close set orasession=nothing end sub function displayerror() if err.number <>0 then Response.Write "
数据库连接失败,请与系统管理员联系!
(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/asp/)" Response.End end if end function %>解决办法:1、IIS要访问ORACLE数据库时,在OLEDB中赋于一个权限(是ORACLE的BUG)在ORACLE_HOME目录下ORA92目录的属性里的安全性上添加/编辑“Authenticated Users”用户,在其“读取及运行”权限上先点不选,再点选择,然后“应用”。2、在ORACLE_HOME目录下ORA92networkADMIN目录里有一个“sqlnet.ora”文件,内容如下:# SQLNET.ORA Network Configuration File: E:oracleora92networkadminsqlnet.ora# Generated by Oracle configuration tools.NAMES.DEFAULT_DOMAIN = jgc-new.localSQLNET.AUTHENTICATION_SERVICES= (NTS)NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)将其改为:# SQLNET.ORA Network Configuration File: E:oracleora92networkadminsqlnet.ora# Generated by Oracle configuration tools.NAMES.DEFAULT_DOMAIN = jgc-new.local# SQLNET.AUTHENTICATION_SERVICES= (NTS)NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)