473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Problem to connect Oracle from ASP

2
Hello,

I want to connect to an Oracle 9.2 database from a web site.

- I have created a DSN file, I access the database from Excel
- I have written the following vbScript, that works:
Expand|Select|Wrap|Line Numbers
  1.  
  2. dim rs
  3. Dim connString
  4. Dim conn
  5. Dim SQL
  6.  
  7. set conn = createobject("ADODB.Connection")
  8.  
  9. Const DSN = "MonDSN"
  10. Const UserID = "MonUID"
  11. Const Password = "MonMdP"
  12.  
  13. connString="dsn=" + DSN + ";uid=" + UserID + ";pwd=" + Password + ";"
  14.  
  15. conn.open connString
  16.  
  17. set rs = conn.execute ("select * from toto")
  18.  
  19. msgbox(rs.eof)
  20. conn.close
  21.  
  22.  
  23. - I have adapted it in ASP:
  24. <html>
  25. <body>
  26. <%
  27.  
  28. dim rs
  29. Dim connString
  30. Dim conn
  31. Dim SQL
  32.  
  33. set conn = createobject("ADODB.Connection")
  34.  
  35. Const DSN = "MonDSN"
  36. Const UserID = "MonUID"
  37. Const Password = "MonMdP"
  38.  
  39. connString="dsn=" + DSN + ";uid=" + UserID + ";pwd=" + Password + ";"
  40.  
  41. conn.open connString
  42.  
  43. set rs = conn.execute ("select * from toto")
  44.  
  45. response.write(rs.eof)
  46. conn.close
  47. %>
  48.  
  49.  
  50. I have the following error:
  51. Microsoft OLE DB Provider for ODBC Drivers error '80004005' 
  52. [Microsoft][ODBC driver for Oracle][Oracle]Error while trying to retrieve text for error ORA-12158 
  53.  
I tried to connect to an SQL Server database using the same method, that works.
I have read/write rigths on the DSN file (it is placed in web site directory)

Can somebody help me, please?

Thanks in advance
Mar 5 '08 #1
2 1855
jeffstl
432 Expert 256MB
Your DSN may take care of this as I am not sure what is in specified in the DSN file.

However you will need to at some point refer a provider for the web server to utilize in your connection string

Provider=OraOLEDB.Oracle

This is a possibilitiy.
Apr 9 '08 #2
dounax
2
Thanks.

That works with ODBC link 'Oracle dans OraHome92'

:)
Apr 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Benson, John | last post by:
Hi, I'm a non-Oracle guy just starting to use Python to explore Oracle. I enclose the Python command prompt log for the usage example further down with only the user, password and host names...
2
by: Hari Om | last post by:
Cannot connect as Internal Hello, I am using IBM AIX 5.1L box for Oracle 9.2.0.1. I cannot connect as internal to my DB INstance - wonder why? Here is what is do:...
2
by: Chris | last post by:
A weird issue...though hopefully not for everyone... I am trying to connect to a 10g database on a Red Hat Linux server from my 9i client on a XP pc. Both are on my local home network, behind...
5
by: SerGioGio | last post by:
Hello, I am going nuts. I am trying to connect to my local ORACLE instance using ODBC. It used to work few weeks ago, but it fails now. Connection with: - SQL*plus: connection works! -...
5
by: jrefactors | last post by:
My machine is Windows XP with Oracle 9.2 Home; IIS and Oracle are in the same box. I have tried both Oracle OLEDB Provider and Microsoft ODBC For Oracle, but both not working. For Microsoft...
4
by: BookerW | last post by:
I am not sure which forum I should post this on, but here is the problem. I have a front end web application(VB) on asp,net 1.1 framework. Inside of the code, I have the following lines to...
3
by: Budd | last post by:
I don't know how to connect to oracle database by asp.net Anyone have any simple or step for me to connect?? i have no idea.... i have search from google and get the code But it seen i have miss...
1
by: Roka | last post by:
Hi all. I'm using PHP to connect Oracle with OCI . But a serious problem ocurred. If the network error happened that I cannot connect to Oracle DB , and then I fixed the network problem, but I...
7
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work....
9
by: D. Patrick | last post by:
I need to connect to an Oracle database. I've never done it before. I see that with framework 1.1 you had to download ODP.NET from Oracle's site in order for the framework classes to even work....
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.