首页  »  网页设计教程  »  ORACLE920和ASP的连接问题的解决办法

ORACLE920和ASP的连接问题的解决办法

浏览数:共 48 次     评论:共 0 条     发布日期:2011-08-17     分类:asp

代码如下:<% on error resume next "连接数据库 set orasession = createobject("oracleinprocserver.xorasession") set oradatabase=orasession.dbopendatabase("数据库名","用户名/密码",0) "出错处理 if err.number >0 then response.write "

asp 错误控制

" response.write "asp 错误来源:"&err.source &"
" 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 "


数据库连接失败,请与系统管理员联系!

" response.end end if end function %>解决办法:1、iis要访问oracle数据库时,在oledb中赋于一个权限(是oracle的bug)在oracle_home目录下ora92目录的属性里的安全性上添加/编辑“authenticated users”用户,在其“读取及运行”权限上先点不选,再点选择,然后“应用”。2、在oracle_home目录下ora92 etworkadmin目录里有一个“sqlnet.ora”文件,内容如下:# sqlnet.ora network configuration file: e:oracleora92 etworkadminsqlnet.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:oracleora92 etworkadminsqlnet.ora# generated by oracle configuration tools.names.default_domain = jgc-new.local# sqlnet.authentication_services= (nts)names.directory_path= (tnsnames, onames, hostname)



上一篇:asp模仿 Lotus Notes 的界面程序
下一篇:利用SQLSERVER存储过程实现ASP用户身份验证