473,549 Members | 2,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem to connect Oracle from ASP

2 New Member
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 1860
jeffstl
432 Recognized Expert Contributor
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=OraOLE DB.Oracle

This is a possibilitiy.
Apr 9 '08 #2
dounax
2 New Member
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
5225
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 changed to keep me out of trouble. But first, I'd like to point out that I'm able to logon to myhost, and get into the following via SQL*Plus using...
2
21232
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: ------------------------------------------------------------------- $export ORACLE_SID=GATES
2
10486
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 a router. I can ping the linux server from my XP box successfully: C:\>ping 192.168.1.101
5
102514
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! - DataDirect 5.0 Oracle Wire protocol (3rd party ODBC driver): connection works when I hit the driver's "test connection"
5
13199
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 ODBC For Oracle approach, I added a data source in Oracle Data Source Administrator, in System DSN tab, I created a system data source named...
4
5709
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 connect to the database If gbSQLServer Then 'sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=c:\w\vgyl\hy.mdb" gsConnectionString =...
3
1674
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 some step .... My case is....school have provided the oracle for me to connect so i need to install oracle client for my pc??
1
1321
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 also cannot connect to Oracle DB until I restarted the Apache server. Anyone knows how to solve this problem. Thanks a lot!!
7
4345
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. I tried that quickly, but the file is 400 MB, and the the installation asks for all kinds of things in order to install. Now I'm very confused....
9
2398
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. I tried that quickly, but the file is 400 MB, and the the installation asks for all kinds of things in order to install. Now I'm very confused....
0
7446
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7469
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7808
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.