...

View Full Version : Connecting to a Oracle DB using ASP



suu
07-15-2005, 01:34 PM
Hello!

I've never done this so i'm gonna need your help. I've always connected to an Access DB much like this:
----------------------------------------------------------
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=\\Sacavem07\intranet\BD_CA.mdb;" &_
"User Id=admin;" &_
"Password="
Set RS = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM TBL_0IndicRel"
RS.Open strSQL,Conn,1,2
------------------------------------------------------------

Is there a way to connect to an ORACLE DB much like this? I would prefer not to use a ODBC. And how does a person do a select? Does it work the same way?

We're working with SAP 8.7 or something like that so the Oracle DB must be also version 8 right? i confess i'm guessing here.

I found this piece of code but it's not working:
------------------------------------------------------------
Set Conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=OraOLEDB.Oracle;" &_
"Data Source=172.16.7.201/P51;" &_
"User Id=admin;" &_
"Password="
--------------------------------------------------------------

Thank you!

suu
07-15-2005, 01:39 PM
the Oracle version is 8.7.1

glenngv
07-15-2005, 03:40 PM
http://www.carlprothman.net/Default.aspx?tabid=87#OLEDBProviderForOracleFromOracle

suu
07-15-2005, 03:53 PM
i'm really new at this. i've never done a Oracle connection and i've already searched several sites.

what i have is this:
-------------------------------------------------------
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=MSDAORA;Data Source=172.16.7.201/P51;
User Id=EQOBRAS;Password=serbiqe"
-------------------------------------------------------

it doesn't work. it returns the error:

----------------------------------------------------------
Microsoft OLE DB Provider for Oracle error '80004005'

Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle Version 7.3.3 or later client software installation. Provider is unable to function until these components are installed.
----------------------------------------------------------

i don't understand. what more does it need?

glenngv
07-15-2005, 04:00 PM
There's a note in the link I posted, that says:

Note: "Data Source=" must be set to the appropriate Net8 name which is known to the naming method in use. For example, for Local Naming, it is the alias in the tnsnames.ora file; for Oracle Names, it is the Net8 Service Name.

suu
07-15-2005, 04:08 PM
huh?!

i'm really not understanding you.

i'm really not getting what you're saying.

glenngv
07-15-2005, 04:19 PM
Actually, I haven't work with Oracle before. I was just giving you possible clues for the solution. I noticed that you used an IP address/something for Data Source, which I think is different from that of the link I posted.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum