Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Help with connection to Oracle

Our company has been using Oracle (version 7.3) on a Unix Platform (sun) with an old 4GL language through a telenet session providing a character based application.  I want to move toward a different front end and am thinking VB is the answer using ActiveX.  Unfortunately I am having trouble connecting to the Oracle database.  I have installed Oracle Net and tried setting up a System DSN using Microsoft ODBC Driver for Oracle, but am not sure if I set it up correctly.   I have filled it out as follows: Data Source Name - MYDEV (this is the alias is used in setting up Oracle Net), Description MY DEV, User name dev (this is the the name of my Oracle Database), Connect string sun1 (Wasn't sure what to put here.  This is the system name that Oracle resides on).  When I try and use Oracle NetTest to see if I am connected it always fails. Any help would be appreciated.

Thanks

HS
0
hstein
Asked:
hstein
  • 7
  • 3
  • 3
  • +4
1 Solution
 
AzraSoundCommented:
perhaps an easy way to try and connect would be to stick an ado data control on your form, go to its properties window, click custom, and try to build the connection to a particular database from there.  it allows, after you have gone through a few steps, to test your connection.  just click on projects -> components and check off the microsoft ado data control box and stick it on your form.  
0
 
hsteinAuthor Commented:
Thanks for the suggestion. I tried, but am still getting an error connecting.  I clicked on connection string, clicked on build, selected Microsoft OLE DB Provider for Oracle, clicked on next, entered the server name - sun1 (this is where it seems confusing to me.  The only way for sun1 to resolve itself is using tcp/ip and yet I created an alias in oracle net named MYDEV).  Then I entered user name and password and clicked Test Connection.  I received the following error: Test connection failed because of an error in initializing provider. ORA-1254: TNS: could not resolve service name.

When I entered my alias instead (MYDEV) I received the following error: Test connection failed because of an error in initialzing provider. ORA-01017: invalid username/password:login denied (I have verified that my login and password work in my telenet session).


HS
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
hsteinAuthor Commented:
I read the article.  I am running on an windows 95 system as are most of the clients in my organization.  I was hoping that when the VB program was completed using ADO I could compile and roll it out without having to setup each PC.  Isn't it possible to connect to Oracle on the '95 platform.  

HS
0
 
NancyShahCommented:
Hi hstein,

Just try this ..actually what I feel
is that if you want to use ADO no need of ODBC.
Install your Oracle client on your machine.In this it will ask for the ip address of the server.
once a client is installed you will have 2 thnings with you
1) UserName ==one which you made while installing Client
2) password

Use these 2 things in the Connect string of ADO.
WHere you will need to enter username and password
0
 
AzraSoundCommented:
yes in that case when you go to build the string with the adodc, forego the server entry and just try a username/password entry
0
 
hsteinAuthor Commented:
Maybe I don't have the right Oracle program.  I used Oracle Net Easy Configuration.  This doesn't require a user name or password, just the tcp/ip connection, an alias name,  and the Database instance.  

Hs
0
 
karlwwCommented:
We use Oracle8 on VMS
Our DSN is setup using the MS Oracle driver from MDAC 2.1, using your example we would have a setup like this;

In ODBC Administrator
=====================
Data Source Name: MyDev
Description: DEV Database DSN
Username: (blank)
Server: DEV (name of the Oracle DB)

--------

Using VB/ADO and ODBC driver

Dim cn As New ADODB.Connection

cn.ConnectionString = "DSN=MyDev;UID=scott;PWD=tiger" ' to borrow from the famous Oracle example
cn.Open

or using VB/ADO and MS Oracle provider (in which case you don't need the DSN at all)

cn.ConnectionString = "Provider=MSDAORA;Data Source=dev;User Id=scott;Password=tiger"
cn.Open



0
 
lkeyCommented:
Have you established the relationship between your computer and the instance names on your server?  With NT/98/95 there is a utility called easyconfig that creates a relationship with the TNSNAMES.ORA file.  Unless this relationship is created no ODBC will be able to resolve the connection.
0
 
hsteinAuthor Commented:
I can't get the connection to work.  Maybe I have the wrong Oracle net client - Oracle Net8 Easy Config.  When I open it and pick TCP/IP , then enter the IP address and keep the port number at 1521 (the default), then enter the SID which is DEV.  When I press test and enter login/password I get the following message:The test did not succeed. ORA-01017: invalid username/password; logon denied.  I know my name and  password are valid as I login using a telenet session.

Any ideas?

Thanks

Hs
0
 
karlwwCommented:
Does SQL*Plus even work from your computer?  It sounds like lkey is right.  You've got to get the Oracle networking configured before VB even has a chance.
0
 
hsteinAuthor Commented:
Adjusted points from 75 to 150
0
 
hsteinAuthor Commented:
I can't seem to connect.  Is there a different version of SQL *Net I should be using.  My Oracle version is 7.3.  Could this be causing the problem?
0
 
rfylCommented:
Have you checked that your client computer can 'see' the server?

Try opening a DOS command prompt and typing in 'PING sun1'.  (Assuming sun1 is the Oracle server name).

Hopefully this will return that it was able to ping the server.  If it has not then you need to check your TCP/IP configuration.

Otherwise, I do not know what groups are available here, but as the others have said - your problem is not with Visual Basic, you have a networking/Oracle connection problem.
0
 
hsteinAuthor Commented:
Thank you all.  I have made the connection!! It did turn out to be a problem with the Sun1.  I will be asking that all the points be split among all those that answered.

Thanks
0
 
darinwCommented:
Reveiwing question.

darinw
0
 
darinwCommented:
Community Support has reduced points from 150 to 30
0
 
darinwCommented:
Reducing points to 30 to allow for split.

hstein - You can now accept the proposed answer to award the first Expert. To award the other Experts, you can create new questions in this topic area with a title of 'For ExpertName -- 10338168' using the appropriate Experts username.

Remember, the Accept Comment as Answer button is in the header of the comment.

For your convenience, you can use this link to create the new question (right click and open in a new window):
http://www.experts-exchange.com/bin/NewQForm?ta=31

darinw
Customer Service
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 7
  • 3
  • 3
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now