Re: MS Access selecting from Oracle database

From: Ethan Post <>
Date: Wed, 12 Mar 2008 17:01:16 -0500
Message-ID: <>

Just an FYI for those interested. You can connect from Access without ODBC if you already have Oracle client installed and tnsnames configured. The code below is from a spreadsheet I am working on (I removed the excel stuff) but it would work in Access also if you want to code a connection to Oracle. You need to reference the ADO library from the references menu.

Public Sub TestMe()

   Dim cn As New ADODB.Connection
   Dim rs As New ADODB.Recordset
   Dim i As Long
   Dim sSQLQuery As String


   sSQLQuery = "select x, y, z from test_table;"

   rs.Open sSQLQuery, cn
   i = 1

   Do Until rs.EOF

      i = i + 1



End Sub

Received on Wed Mar 12 2008 - 17:01:16 CDT

Original text of this message