Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: link table , I find it

Re: link table , I find it

From: search <gerry_at_village.uunet.be>
Date: Thu, 30 Oct 2003 11:28:07 +0100
Message-ID: <3fa0e7b9$0$4336$ba620e4c@reader0.news.skynet.be>


Hi Guys ,

I found the solution for linking an oracle attached table in ms-access :

  1. you create a file dsn via your ODBC-manager
  2. You create a new module Attach_Table with function AttachTable : Function AttachTable() As Variant On Error GoTo AttachTable_Err
      Dim db As Database
      Dim tdef As TableDef
      Dim strConnect As String

      Set db = CurrentDb()
      strConnect = "ODBC;FILEDSN=C:\Program Files\Common Files\ODBC\Data
Sources\youdsn.dsn;UID=userID;PWD=password"
      Set tdef = db.CreateTableDef("your_access_table")
      tdef.Connect = strConnect
      tdef.SourceTableName = "oracle_table_that needs_to_be_attached"
      db.TableDefs.Append tdef

AttachTable_Exit:
      Exit Function

AttachTable_Err:
      MsgBox "Error: " & Str(Err) & " - " & Error$ & " occured in global
module."
      Resume AttachTable_Exit

 End Function

3) You create a invisible form, set it in your startup and in the load event you set following code :
Private Sub Form_Load()

    Attach_Tbl.AttachTable
End Sub

4) When you quit your application you delete your attached tables

Thats it and it works fine.....
I 'm a little bit disappointed that The only answer I received was : File->Get External Data->Link Tables
I 'm crying if I receive answers like that.....

Gerry Received on Thu Oct 30 2003 - 04:28:07 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US