ODBC Direct and Oracle 
Author Message
 ODBC Direct and Oracle

Quote:

> [Terry Tuk]
> | I am trying to connect to an Oracle database using ODBC Direct code in
> | VBA from MS Access 97. The Oracle database is Version 7.3 and we have
> | the Oracle ODBC driver Version 1.16 installed.  The code I am using is
> | as follows:
> | Sub TestODBC()
> |
> | 'Declare variables.
> |     Dim ws As Workspace
> |     Dim conPubs As Connection
> |     Dim rs As Recordset
> |
> |     DBEngine.DefaultType = dbUseODBC
> |     Set ws = DBEngine.CreateWorkspace("wrkODBC", "admin", _
> |         "", dbUseODBC)
> |     Set conPubs = ws.OpenConnection("Mine", dbDriverPrompt, False, _
> |         "ODBC;DATABASE=MARRIAGE;UID=tatuk;PWD=oracle;DSN=VS02")
> |
> |     Set rs = conPubs.OpenRecordset _
> |         ("SELECT * FROM GROOM_AGE")
> |     'Debug.Print rs(0), rs(1), rs(2)
> |     rs.Close
> |     conPubs.Close
> |     ws.Close
> | End Sub
> |
> | The code seems to open the connection to the database but fails when I
> | try to open the recordset.  I get a Microsoft runtime error 3146 "ODBC--
> | call failed".  Any ideas?

> [Pavel SKYBA]
> | Hi,
> | Try replace string
> | "ODBC;DATABASE=MARRIAGE;UID=tatuk;PWD=oracle;DSN=VS02"
> | with string like "DATABASE=MARRIAGE;UID=tatuk;PWD=oracle;DSN=VS02"

> [Are Meisfjord]
> Did this work? I've got exactly the same problem as you, Terry, but when I
> tried removing "ODBC;", all I got was "Invalid argument".

> Are Meisfjord


When I removed "ODBC" i get an invalid argument as well.  I have no idea
what the problem is.


Sat, 18 Mar 2000 03:00:00 GMT  
 ODBC Direct and Oracle

[Terry Tuk]
| I am trying to connect to an Oracle database using ODBC Direct code in
| VBA from MS Access 97. The Oracle database is Version 7.3 and we have
| the Oracle ODBC driver Version 1.16 installed.  The code I am using is
| as follows:
| Sub TestODBC()
|    
| 'Declare variables.
|     Dim ws As Workspace
|     Dim conPubs As Connection
|     Dim rs As Recordset
|        
|     DBEngine.DefaultType = dbUseODBC
|     Set ws = DBEngine.CreateWorkspace("wrkODBC", "admin", _
|         "", dbUseODBC)
|     Set conPubs = ws.OpenConnection("Mine", dbDriverPrompt, False, _
|         "ODBC;DATABASE=MARRIAGE;UID=tatuk;PWD=oracle;DSN=VS02")
|        
|     Set rs = conPubs.OpenRecordset _
|         ("SELECT * FROM GROOM_AGE")
|     'Debug.Print rs(0), rs(1), rs(2)
|     rs.Close
|     conPubs.Close
|     ws.Close          
| End Sub
|
| The code seems to open the connection to the database but fails when I
| try to open the recordset.  I get a Microsoft runtime error 3146 "ODBC--
| call failed".  Any ideas?

[Pavel SKYBA]
| Hi,
| Try replace string
| "ODBC;DATABASE=MARRIAGE;UID=tatuk;PWD=oracle;DSN=VS02"
| with string like "DATABASE=MARRIAGE;UID=tatuk;PWD=oracle;DSN=VS02"

[Are Meisfjord]
Did this work? I've got exactly the same problem as you, Terry, but when I
tried removing "ODBC;", all I got was "Invalid argument".

Are Meisfjord



Sat, 18 Mar 2000 03:00:00 GMT  
 ODBC Direct and Oracle



Quote:
> [Terry Tuk]
> | I am trying to connect to an Oracle database using ODBC Direct code in
> | VBA from MS Access 97. The Oracle database is Version 7.3 and we have
> | the Oracle ODBC driver Version 1.16 installed.  The code I am using is
> | as follows:

I think this depends on which driver you are using, if you are using the
Oracle7.3 driver from ORACLE then I cannot help you
but if you are using Microsofts ODBC driver then I suggest this for the
connect string:

"DATABASE=MARRIAGE;UID=tatuk;PWD=oracle;CONNECTSTRING=<alias>"
or
"DATABASE=MARRIAGE;UID=tatuk;PWD=oracle;CONNECT=<alias>"
where alias = the alias specified in the SQL*Net

This is considered a DSN-Less connection, so you would not have to have the
datasource setup in ODBC.

This is just from my limited experience with RDO/Visual Basic/Oracle and
may not apply to your situation. I have never tried ODBC direct. But I have
a suspicion that the odbc driver from microsoft is meant to be used for a
DSN-Less connection. And I maybe totally wrong.

Quote:
> Are Meisfjord




Sat, 25 Mar 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ODBC Direct and Oracle 7

2. ODBC Direct and Oracle

3. Cant add records to Oracle table using ODBC Direct

4. Direct connection to Oracle without ODBC?

5. Oracle ODBC driver / Microsoft ODBC driver for Oracle

6. ODBC, ODBC Direct, SQLVB ?

7. NT3.51-Oracle ODBC-Oracle DB

8. Oracle Objects vs Oracle ODBC in VB

9. HELP on connection to Oracle with Microsoft ODBC for Oracle Driver

10. Can't open Oracle database with DAO35 and Oracle-ODBC

11. ODBC error, Jet->ODBC->Oracle

12. OCX for Oracle Call Interface (Direct OCI API)

 

 
Powered by phpBB® Forum Software