Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connecting to Oracle DB

Status
Not open for further replies.

FateFirst

Programmer
Apr 15, 2002
212
GB
Im trying to connect to an Oracle DB but considering I've never been anywhere near Oracle before Im becoming quite lost. Client is running Oracle9i on another server located on the network.

Im using the below to try and establish a connection:
Code:
oConn.Open "Driver={Microsoft ODBC for Oracle};" & _
           "Server=SNTEST.world;" & _
           "Uid=SYSADM;" & _
           "Pwd=SYSADM"

On running the page I get:

[tt]
Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: ''
/index.asp, line 7
[/tt]

Line 7 is the oConn.Open line.

Can anyone supply any links or maybe some past experience with oracle?

Not sure if I need to install other items or maybe im going about connecting to the database in the wrong manner.

- FateFirst
 
This is my oracle conn string:
Code:
"Provider=OraOLEDB.Oracle;Data Source=instance.world;Persist Security Info=True;user id=myid;password=mypw;dbDBType=Oracle;PLSQLRSet=1;"
go to the command prompt and see if you can tnsping sntest if that doesnt work.
 
Sheco, No it says the table does not exits.

Error Type:
Microsoft JET Database Engine (0x80040E37)
The Microsoft Jet database engine cannot find the input table or query 'blploct'. Make sure it exists and that its name is spelled correctly.
 
Object required probably means that you dont have a reference to your ADO Connection Object.

Where do you Set the variable named oConn ???


Do you have something like this:
Set oConn = Server.CreateObject("ADODB.Connection")
 
try these


Code:
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft ODBC for Oracle};Server=OracleServer.world;Uid=xyz;Pwd=xyz;Database=tplp;"
Set rs = conn.Execute("SELECT * FROM tblname")
or
Code:
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider = MSDAORA;User ID=myuser;Password=mypwd;Data Source=myserver;DATABASE=mydb;"
Set rs = conn.Execute("SELECT * FROM tblname")
%>
or
Code:
<%
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=MSDASQL;DRIVER={Microsoft ODBC for ORACLE};UID=User;PWD=Password;Server=Your_TNSNames_Alias;DATABASE=mydb;"
Set rs = conn.Execute("SELECT * FROM tblname")
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top