Solved

Oracle, Unix and ADO

Posted on 2002-06-25
6
574 Views
Last Modified: 2013-11-23
I am trying to connect to an oracle database on a unix server.
I was wondering if someone could help me with the connection string.

Here is my info:
I am using vb 6 on an nt machine.
Oracle 8i database(not sure of name) on an Unix server(named woodstock)

I have the "Microsoft ODBC driver for Oracle" MSORCL32.dll installed. I think i need to download a new oracle driver but am unsure of which one.

I have never delt with Unix and am not sure if there are issues i have to deal with. I can get more info from the Oracle DBA or from the network boys, but am unsure of what questions to ask.

any help would be great.
Thanks
Pule

0
Comment
Question by:Wardy
  • 2
  • 2
  • 2
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7108276
0
 

Author Comment

by:Wardy
ID: 7111467
That is a great website and I have used it in the past.
I downloaded the OleDB Provider for Oracle from the Oracle site and installed it.
Now it tells me that
"OraOleDBpus.dll: The specifed module could not be found."

Seems like the install didn't take.  I registered the dll manually and get the same thing.

What is going on?
This should be easy.
Any help out there?
Wardy
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7111651
search for your error on Oracle site.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 1

Expert Comment

by:thanes
ID: 7119507
Do you have the Oracle Client for 8i installed on your development machine?  If not get the client CD from your DBA or hit Oracle's download site (you will need to setup an account with them--time consuming, but free).  Also, wherever you install this application you will also need to install the Oracle Client too--not fun--along with the *.ora configuration files setup.  You may not have to setup these files if your DBA's have setup a Oracle TNS names server.

Once the Oracle Client is installed you will need to go through it's wizards to configure the tnsnames.ora and sqlnet.ora files, or you can do it manually.  These files act like an .ini file for the Oracle Client to know where the database is at, what port numbers they listen too etc.

With the wizards on the Oracle Client you should be able to test that you have a valid connection.  Your DBA's should provide you with a username/password.  Also, you can test with Oracle's SQL*plus which comes with the Oracle Client.  Once, you know you can execute a simple SQL statement with SQL*plus you will be ready to deal with OLEDB or ODBC--whichever you prefer.  I prefer OLEDB because there is a simple "build" connection string wizard that comes with it where you can test the connection before you bother trying to write any VB code.

Good luck!
0
 
LVL 1

Accepted Solution

by:
thanes earned 450 total points
ID: 7119514
Basically, the steps are the following:

1. Install the Oracle Client on development machines and all other machines where this application will run.

2. Networking...there are many questions to ask here!  You may have a manually maintained IP network where all of your IP address to IP hostnames are stored in a local host file?  Or you may have DHCP for assigning addresses and a DNS server that resolves the IP address to IP hostname?  Or maybe you don't use IP?  Maybe your running on some old Netware 2.x / 3.x environment?  But if you can successfully ping your Unix box then you are likely going to be able to go to the next step just fine.  If not start getting your LAN guys to help with the pinging.

3. Determine if DBA's have a TNS names server.  If not you will need to find out the database name, username, password for all schemas you will be need to user.  Then configure the tnsnames.ora and sqlnet.ora files accordingly.  There is usually some instructions in the comments of these two files.  They are found in the Oracle install path of your local machine from the Oracle Client installation.

4. Test that you have a valid connection that works using SQL*Plus.  SQL*plus is usually installed when you install the Oracle Client.  Do a simple SELECT against a table once you get connected with SQL*plus.

5. Make sure you are using MDAC 2.6 or greater (2.5 may work fine too, but I can guarantee no problems with 2.6 and Oracle 8i from my experience).

6. Within VB 6 (Enterprise I hope) drop in the Project|References and select "Microsoft ADO 2.6 library" for enabling ADO.  Finally, write your code:

    Dim rs As ADODB.Recordset
    Set rs = New ADODB.Recordset
    rs.open "select * from employees", "...oracle connection stuff..."

7. To get the exact syntax of the Oracle connection you need here I would add the Project|Components and find the ADO connection component and drop it on your form and use its wizard to build an "OLEDB connection for Oracle".  This will allow you to test the connection before you spend more time spinning your wheels writing code until you know you can really see the database from within VB.

Regards, Thane Schaffer

 
0
 

Author Comment

by:Wardy
ID: 7121983
Great answer.
I found a lot of this out on my own.  I have been able to connect to the database.  I downloaded an oracle oledb driver and client and had to talk to my DBA about the tsnames.ora file and the database name. I am running MDAC 2.5 and might download 2.6 just to be sure.

If i had anymore points I would increase the award for this question. You deserve it.
Thanks
Wardy.

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

786 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