Failed to connect to Oracle

Failed to connect to Oracle

Post by Jim » Tue, 25 Feb 2003 13:36:34



Hi,there,
   My odbc driver is "Microsoft ODBC for
Oracle"(2.573.9030.00),DB is Oracle9.2, language is VB6
with sp5, it works when I test it in the ODBC data source
administrator,but when I use the following snippet code to
connect to oracle,it pop up error missage:
Source code:
    Dim ConnStr As String
    Dim cn As ADODB.Connection

    ConnStr= "DNS=MedOra92;UID=SYSTEM;PWD=stmsom;"    
    Set cn = New ADODB.Connection

    With cn
          .CursorLocation = adUseClient
          .Provider = "MSDAORA"
    End With

    cn.Open ConnStr

Error Message:

   "Runtime error '-2147467259(80004005)',oracle error
ocurred,but error message could not be retrieved from
Oracle." I ever use driver"Oracle in OraHome81"(9.02.00.00)
to create data source,it popup the same error message,I
already installed MDAC_TYP(2.7) and configure listener.

Any idea,pls revert me, thanks!!
Jim

N.B: I have 2 DB with the same listener and same port
(1521).

 
 
 

Failed to connect to Oracle

Post by Paul Clemen » Wed, 26 Feb 2003 00:49:13


Hi,there,
   My odbc driver is "Microsoft ODBC for
Oracle"(2.573.9030.00),DB is Oracle9.2, language is VB6
with sp5, it works when I test it in the ODBC data source
administrator,but when I use the following snippet code to
connect to oracle,it pop up error missage:
Source code:
    Dim ConnStr As String
    Dim cn As ADODB.Connection
   
    ConnStr= "DNS=MedOra92;UID=SYSTEM;PWD=stmsom;"    
    Set cn = New ADODB.Connection
   
    With cn
          .CursorLocation = adUseClient
          .Provider = "MSDAORA"
    End With
   
    cn.Open ConnStr

Error Message:

   "Runtime error '-2147467259(80004005)',oracle error
ocurred,but error message could not be retrieved from
Oracle." I ever use driver"Oracle in OraHome81"(9.02.00.00)
to create data source,it popup the same error message,I
already installed MDAC_TYP(2.7) and configure listener.

Any idea,pls revert me, thanks!!
Jim

N.B: I have 2 DB with the same listener and same port
(1521).

Try changine "DNS" to "DATA SOURCE". It looks like you're mixing ODBC connection string parameters
with OLEDB.


Microsoft MVP (Visual Basic)

 
 
 

1. why alway fail to connect to Oracle FIRST TIME?

When we run SQL_NAVIGATOR for the first time, got error:
ORA_12571:TNS:packet writer failure
(note: user/password/connecting string are correct)
while in the 2nd time, we type in the same user/password/connecting string
again, it connected successfully .

Why alway fail to connect to Oracle at the first TIME? How can we fix it?

Thank you for input!

Amy

2. Bulk Copy in SQL 7.0

3. Help! VB using ODBC failing to connect to Oracle

4. INGRES & CASE TOOLS

5. Client connect gets ORA-12545: Connect failed for Oracle 8i listener

6. PG_DUMP NLS (Russian)

7. User / System DSN fails to connect Oracle Database using Microsoft ODBC for Oracle

8. D3 Object and VB6

9. DTS execution from client machine fails connecting to Oracle

10. EXPORT, DBA Studio VTK1000 error, connect fail for Oracle Management Server

11. DBI/DBD/Oracle connect failing (ORA-12154)

12. Connect failed on oracle 8.1.7