Solved

error when you connect to Oracle database through ODBC

Posted on 2008-10-13
4
590 Views
Last Modified: 2013-12-19
I am getting this error message when my application tries to connect the base version Oracle 9i by ODBC.
0
Comment
Question by:arof
4 Comments
 
LVL 17

Expert Comment

by:sweetfa2
ID: 22708117
Have you set up the ODBC name on your windows box.
0
 
LVL 47

Accepted Solution

by:
schwertner earned 500 total points
ID: 22709814
You have to provide correct access details (that describe the location of Oracle instance, SId, etc.)
like:

Dim strCon
strCon = "Driver={Microsoft ODBC for Oracle}; " & _
         "CONNECTSTRING=(DESCRIPTION=" & _
         "(ADDRESS=(PROTOCOL=TCP)" & _
         "(HOST=mysrv)(PORT=7001))" & _
         "(CONNECT_DATA=(SERVICE_NAME=MYDB))); uid=read;pwd=read;"

Dim oCon: Set oCon = WScript.CreateObject("ADODB.Connection")
Dim oRs: Set oRs = WScript.CreateObject("ADODB.Recordset")
oCon.Open strCon
Set oRs = oCon.Execute("SELECT myfield FROM mytable)
While Not oRs.EOF
    WSCript.Echo oRs.Fields(0).Value
    oRs.MoveNext
Wend
oCon.Close
Set oRs = Nothing
Set oCon = Nothing
0

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Creating and Managing Databases with phpMyAdmin in cPanel.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Via a live example, show how to take different types of Oracle backups using RMAN.

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question