Results 1 to 5 of 5
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    ISAM error - seems to be above my paygrade

    Well, I thought this was going to be simple, but I guess not. (In my old vocabulary, ISAM is a mainframe access method) Anyway, I've not been successful in finding a reasonable explanation that fits what I'm trying to accomplish.



    strPerDB is global and is the name of an alternate backend DB.

    The error:
    Click image for larger version. 

Name:	000.jpg 
Views:	12 
Size:	23.9 KB 
ID:	49113
    Code:
    Code:
    Option Compare Database
    Option Explicit
    Public Sub CCAcctTrans()
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '  Test new function to access CC traffic.
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    MsgBox ADDCCAccts
    End Sub
    Private Function ADDCCAccts() As Boolean
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    '  Connect to the CCTrans table temporarily to see if there's any CC traffic that
    '  needs to be recorded.
    '*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*
    Dim tdf As New DAO.TableDef
    
    
    On Error GoTo LinkError
    
    
    With CurrentDb
    
    
        .TableDefs.Refresh
        
        Set tdf = .CreateTableDef("tblCCTrans")
        tdf.Connect = "tblCCTrans"
        tdf.SourceTableName = strPerDB
        .TableDefs.Append tdf                              <<<<<<<<<<<<<<<< gets the 3170 on this statement
        .TableDefs.Refresh
    
    
    End With
    
    
    Set tdf = Nothing
    
    
    ErrExit:
    
    
    ADDCCAccts = False
    Exit Function
    
    
    LinkError:
        MsgBox "Error encountered linking to CC Traffic table" & vbNewLine & _
               "Description: " & Err.Description & " Error# = " & Err.Number
               
        GoTo ErrExit
    End Function

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,943
    So how can a sourcetablename be a db and not a table?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Usually you link another database table using the Docmd.TransferDatabase method; if you want to use CreateTableDef method you need to look closer at its arguments, the Connect string must be the correct connection string for the external database type, for an Access db back-end it would like something like this:

    Code:
    ;DATABASE=C:\_Access\DCIS_DB_BE.mdb
    So your code should be:
    Code:
        tdf.Connect = ";DATABASE=" & strPerDB & ""
        tdf.SourceTableName = "tblCCTrans"
        .TableDefs.Append tdf                              <<<<<<<<<<<<<<<< gets the 3170 on this statement
        .TableDefs.Refresh
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I was off on the wrong foot here. And, as I sought to provide a description to further explain, the issue disappeared as I approached the need in a far simpler and appropriate manner. Namely, a permanent link to the table in an alternate DB that remains "unmolested" during a link refresh as the app switches between multiple backends as the app instances require. But, thanks for the heads-up with the Docmd.TransferDatabase method.

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 08-08-2021, 02:26 AM
  2. Replies: 3
    Last Post: 05-06-2015, 12:19 PM
  3. Could Not Find Installable Isam
    By jerem in forum SQL Server
    Replies: 1
    Last Post: 07-22-2014, 03:32 PM
  4. Replies: 1
    Last Post: 11-06-2013, 09:46 AM
  5. ISAM not found
    By amerifax in forum Access
    Replies: 2
    Last Post: 02-02-2013, 06:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums