VBA - Linking Problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikemm
    New Member
    • Apr 2007
    • 2

    #1

    VBA - Linking Problem

    Hi,

    I am trying to link oracle tables through VBA. Using the following code:

    Dim db As DATABASE
    Dim tdf As TableDef
    Dim strConnect As String
    Dim strTable As String
    strTable = "TableName"
    Set db = CurrentDb()
    Set tdf = db.CreateTableD ef(strTable)
    tdf.SourceTable Name = strTable
    strConnect = "ODBC;DSN=<dsnn ame>;SERVER=<se rver>;PWD=<pwd> ;UID=<uid>"
    tdf.Connect = strConnect
    db.TableDefs.Ap pend tdf
    db.Close
    End Sub

    I get the following error : "There are several tables with that name. Please specify owner in the format 'owner.table'. (Error 3298)".

    I have tried specifying <uid>.tablename .....but it doesnt work....

    Any suggestions..
  • Denburt
    Recognized Expert Top Contributor
    • Mar 2007
    • 1356

    #2
    Where I currently work they name the Oracle tables Something.Somet hing and MS Access converts this to Something_Somet hing so if i look at the linked table I see one thing but if I highlight the link and hover over it with the mouse I can see in the tips area that lights up and shows the complete connection and that shows the table name as it should (Something.Some thing).

    Do you think this could be the issue? I am sure you will find quite a few issues when trying to tie into and work with Oracle, although I have had much success.

    Comment

    • mikemm
      New Member
      • Apr 2007
      • 2

      #3
      gave the source table name as <uid>.<tablenam e> and it worked...thanks .

      Comment

      • Denburt
        Recognized Expert Top Contributor
        • Mar 2007
        • 1356

        #4
        Awesome glad i could help. :)

        Comment

        Working...