Solved

Oracle, Unix and ADO

Posted on 2002-06-25
6
573 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 69

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 69

Expert Comment

by:Éric Moreau
ID: 7111651
search for your error on Oracle site.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now