odbc连接oracle,报错0x80004005

secondlf 2003-08-21 05:44:05
我用asp作的网站,在www服务器上安装oracle客户端,通过odbc连接oracle服务器,一直都很正常,最近忽然就报错如下:
错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
/tjjNEWS/PUBLIC/CONN.ASP, 第 5 行

这就是我的连接数据库文件。如下:
strsql = "DSN=newsdb;UID=newsdb;PWD=admindb;SERVER=intradb"
set conn=server.createobject("ADODB.CONNECTION")
conn.open strsql

但是oracle客户端可以连接到服务器上,就是odbc连不上。
三天来,我拭遍了所有的手段,包括重新安装客户端,都不起作用。
东西太多,我实在不想格式化机子啊。

我用dreamwaver里面的数据源连接测试,成功。我甚至可以看到数据库里面的字段。
这是不是说明odbc没问题?那问题出在哪儿呀,为什么一用ie 就报错。

这是我已经问过的帖子大概是回帖太多已经没人朝里我了
http://expert.csdn.net/Expert/topic/2168/2168962.xml?temp=3.063381E-03
哪位高人能够救我,300分相赠。
...全文
379 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
kmstats 2003-11-29
  • 打赏
  • 举报
回复
遇到同样的问题,困扰多天,现在解决了。
将web站点的安全级别设为低,点卸载,重启,即可。
chanet 2003-08-29
  • 打赏
  • 举报
回复
用 ODBC 不如用 ADO :)

beckhambobo 2003-08-29
  • 打赏
  • 举报
回复
不用odbc,用其它驱动不行吗
Tom_Tan 2003-08-29
  • 打赏
  • 举报
回复
重新配置odbc
shuki 2003-08-25
  • 打赏
  • 举报
回复
是不是你安装了什么软件,将注册表里的之改变了。
可能是版本升级或是降级了。
所以无法运行odbc
enhydraboy 2003-08-25
  • 打赏
  • 举报
回复
希望下面的说明对你有用
The following is a list of general steps to take when you investigate a connectivity problem between ASP and an Oracle database.
First verify that you can connect to Oracle and retrieve data using Oracle's SQL Plus utility (a command line-based query utility). If you cannot connect from this tool, then you either have a bad installation or configuration of the Oracle client components or you did not correctly use the SQL Net Easy Config or Oracle Net8 Easy Config utility to create an alias for the Oracle server. You must work with your Oracle database administrator to make sure that the necessary Oracle components have been installed and are configured correctly.
If the Oracle client was recently installed on the Internet Information Server (IIS) computer, make sure that the computer has been rebooted at least once. In some cases after installation, the Oracle component SQL Plus works fine, but connectivity from IIS does not work until you reboot the computer.
Look for multiple copies of the OCIW32.dll file on the IIS server. There should only be one copy of this .dll file on the computer, and it should be in the \Bin subfolder of the Oracle home folder. If you find other copies, rename these with a .bak extension and then retest connectivity. You may want to restart the IIS services after renaming any additional copies of the .dll file that you found.
Make sure that you are running the recommended versions of the Oracle components. You can verify these from the following Microsoft Knowledge Base article:
193225 How to Configure IIS to Connect to Oracle from ASP and ADO

If you need patches, you can obtain these from the Oracles FTP site ftp://Oracle-ftp.oracle.com. For more information on how to obtain and install these patches, work with your database administrator or contact Oracle Technical Support. (Microsoft Technical Support does not support the configuration of these Oracle components.
Check to make sure that the Oracle client components are installed locally on the IIS server. While it is possible to get other applications to work without the Oracle components installed locally, this causes problems when you work with ASP applications. Microsoft recommends that these components be installed on the IIS server; other custom configurations are not supported.
Look at the system environment variables on the IIS computer and check the PATH variable. If there are any remote share names or mapped drives that point to locations that contain Oracle components, remove them. You must reboot the computer in order for any changes that you make to take effect.
Look again at the system environment variables on the IIS computer and check the PATH variable. Make sure that the \Bin folder in the Oracle home directory is included as part of the PATH environment variable. With a default installation, this is the Orant\Bin folder. Again, you must reboot the computer for the changes that you make to take effect.
Try to connect with both the Microsoft ODBC for Oracle driver and the Microsoft OLEDB Provider for Oracle. Here are sample connection string syntax for each of these:'Microsoft OLEDB Provider for Oracle
"Provider=MSDAORA.1;Data Source=Your_TNSNames_Alias;User ID=User;Password=Password"

'Microsoft ODBC for Oracle DSN-Less
"Provider=MSDASQL;DRIVER={Microsoft ODBC for ORACLE};UID=User;PWD=Password;Server=Your_TNSNames_Alias"

'Microsoft ODBC for Oracle using a DSN
"DSN=Your_DSN_Name;UID=User;PWD=Password"

Disable SQL*Net Authentication. To do this, edit the SQLNET.ora file. This configuration file is usually stored in the Network\Admin subfolder of the Oracle home folder. Add the following lines to this file: SQLNET.AUTHENTICATION_SERVICES = (none)
SQLNET.AUTHENTICATION = (none)

Restart the IIS service after you make these changes.
Add the IUSR_machine name account and the IWAM_machine name account to the Oracle home folder. Give both accounts full control.

To do this, right-click on the Oracle home folder in Windows Explorer. Click Properties, and then click the Security tab. Add the appropriate accounts and then give them full control. Restart your computer.
The third-party products that are discussed in this article are manufactured by companies that are independent of Microsoft. Microsoft makes no warranty, implied or otherwise, regarding the performance or reliability of these products.

Microsoft provides third-party contact information to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.


from: http://support.microsoft.com/default.aspx?scid=kb;EN-US;255084
enhydraboy 2003-08-25
  • 打赏
  • 举报
回复
你有具体的错误信息么,0x80004005是一个很广泛的错误号,应该有具体的提示的。

Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Oracle][ODBC][Ora]ORA-12154: TNS:Could not resolve service name /vdir/filename.asp, line xxx.

我建议你,编写一个vb程序测一下。
enhydraboy 2003-08-25
  • 打赏
  • 举报
回复
疑惑中。
secondlf 2003-08-21
  • 打赏
  • 举报
回复
我现在就是在ie里连接报错,其他地方无论是sql plus还是Enterprise manager console还是dreamwaver都是连接正常的要命。

我怀疑是系统的这个对象有问题。可是又不知道该怎么检查,去哪儿检查。
set conn=server.createobject("ADODB.CONNECTION")

LGQDUCKY 2003-08-21
  • 打赏
  • 举报
回复
用SQLPLUS newsdb/admindb@intradb 能连接的上吗?

17,377

社区成员

发帖
与我相关
我的任务
社区描述
Oracle 基础和管理
社区管理员
  • 基础和管理社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧