Hello guys,
I have Oracle9i installed in my homepc and my O.S. is Windowsxp-professional. Now,I want to connect Vb using Microsoft OLE DB Provier for oracle. For this i have done the following steps---
1. Created a text document and renamed it with extension .udl
2. On openning the file i got a provider window from where i selected Microsoft OLE DB Provier for oracle and clicked next
3.In the connection window i gave username & password of my oracle database (ofcourse i didn't give host string, being a homepc i'm not connected to any lan)

But after doin this when i'm testing the connection with test connection button it gives error message--
conection failed.error message cannot be rerieved from oracle

I'm not getting what is the problem . please help me out....

Dani AI

Generated

Brief, practical checklist that builds on 's nudge to show your TNS files.

If a command-line Oracle client works while the UDL test using the Microsoft OLE DB provider fails, focus on three areas first: name resolution (tnsnames.ora), the listener, and which Oracle client the provider is actually loading. Common root causes are a missing/incorrect TNS alias, no listener running (sqlplus can use a local BEQ connection while OLE DB expects a network service), or a different Oracle home/path being used by the provider.

Do these quick checks from a Windows command prompt:

tnsping YOUR_SERVICE_NAME
lsnrctl status
echo %PATH%
echo %ORACLE_HOME%

If tnsping fails, add a simple TNS alias for local testing (example below) into the tnsnames.ora placed in the NETWORK\ADMIN folder used by the Oracle client the provider loads. If lsnrctl shows the listener is down, start it.

Example minimal tnsnames.ora entry for a local listener:

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

Try switching the UDL provider to Oracle's OLE DB provider (OraOLEDB.Oracle) rather than Microsofts MSDAORA — the Oracle provider is more compatible with 9i and surfaces clearer error messages. A simple provider string looks like:

Provider=OraOLEDB.Oracle;Data Source=ORCL;User Id=youruser;Password=yourpw;

If these steps do not resolve it, post the exact tnsnames.ora and sqlnet.ora you are using, the full Data Source value you put in the UDL, and the listener status output. That information makes it straightforward to spot mismatches between the client used by sqlplus and the client the OLE DB provider is trying to use.

Recommended Answers

All 3 Replies

Can you connect using sqlplus?

yes sqlplus is working properly.....

That's good.
Do you have a valid tnsnames.ora and sqlnet.ora file? ie., please post them here.
They are in your Oracle home directory (like ORA92)

If you version of 9i is old they will be in (oraclehome)\NET80\ADMIN
Otherwise they will be in (oraclehome\NETWORK/ADMIN

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.