Senin, 05 Mei 2014

Re: [MS_AccessPros] Error with backend tabledef

 

Good morning John,
I have tried put did not find reference.  I then added the code to my attachagain procedure to debug with the as follows with the indicated results:

==============================================
Public Function AttachAgain(strPath As String) As Integer
' This is a generic function that accepts a new path name
' and attempts to refresh the links of all attached tables
' Input: Path name as C:\SomeFolder\SomeSubFolder
' Output: True if successful
Dim db As DAO.Database, tdf As DAO.TableDef, rst As DAO.Recordset
Dim strFilePath As String, varRet As Variant, intFirst As Integer
Dim intI As Integer, intK As Integer, intL As Integer
Set db = CurrentDb
' Initialize the full file path

strFilePath = strPath                                ' <=== name of the backend db
' Set the "first table" indicator
intFirst = True
' Turn on the progress meter
varRet = SysCmd(acSysCmdInitMeter, "Reconnecting Data...", db.TableDefs.Count)
MsgBox "Count = " & db.TableDefs.Count
' Set an error trap
On Error GoTo Err_Attach
' Attempt to reattach the tables
intI = 0 ' Reset the status meter counter
For Each tdf In db.TableDefs
   ' Looking for attached tables
   If (tdf.Attributes And dbAttachedTable) Then
      ' Figure out if this is mdb or xls file attached
      If InStr(tdf.Connect, ".accdb") <> 0 Then
        MsgBox "name = " & tdf.Name & "      " & tdf.SourceTableName
         ' Change the Connect property to point to the new file
         tdf.Connect = ";DATABASE=" & strFilePath
         ' Attempt to refresh the link definition
         tdf.RefreshLink
==========================================
The db.TableDefs.Count  is  22
The first dbf.Name and tdf.SourceTableName are :  ᷉TMPCLP142321 tblPaymentPlans
(note there is a tilde in front of the TMPCLP142321 think that makes it a system table?)  Error occurs at tdf.RefreshLink

I only have six tables in the application.  I was thinking of creating a new database and copying each form, query, etc. in an attempt to see if that would have an effect.  Any other suggests would be great.
(Windows 8.1 with ACCESS 2010)

Rod



---In MS_Access_Professionals@yahoogroups.com, <JohnV@...> wrote :

Rod-

Clearly your startup code references the old table.  Open the VB Editor and do a search in all modules for the table name.  That should identify the code you need to delete.

John Viescas, Author
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
SQL Queries for Mere Mortals 
(Paris, France)




On May 5, 2014, at 12:28 AM, <desertscroller@...> <desertscroller@...> wrote:

I am setting up a new app using a previous app as the template.  Everything seems to be working except I get error 3011 when the new app runs.  State that a tabledef is not found.  The referenced table was not needed in the new app so I had deleted it from the backend file.  When I reloaded the table in the backend everything works fine; however, the table is not linked to the new app.  Is there a way to release the reference to the tabledef in the application.

Hope this makes sense.
Rod

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Did you check out automatic photo albums in Yahoo Groups?
When you send mail to your Yahoo Group with photos attached, a photo album with attached photos is automatically created. When your group members reply to the email with photo attachments, those photos are added to the 'photomatic' albums automatically!

.

__,_._,___

Tidak ada komentar:

Posting Komentar