Strange problem with link tabels?

sasolini

Registered User.
Local time
Today, 09:57
Joined
Dec 27, 2004
Messages
61
Hey,

Thats the code im using for my starup form, to check if linked tables have a connection:
Code:
Private Sub Form_Open(Cancel As Integer)
Dim LinkSt, errSt

On Error GoTo err_Handler

Debug.Print "[Start Link]" & CurrentDb.TableDefs("tblArhivARM").Connect

LinkSt = DLookup("Nazv", "tblArhvOpir")
LinkSt = DLookup("Nazv", "tblArhvARiM")
LinkSt = DLookup("Nazv", "tblArhvMRiK")
    
'DoCmd.OpenForm "frmMain"
'DoCmd.Close acForm, "frmCheckLinkTablesLinks", acSaveYes


Text0 = Mid(CurrentDb.TableDefs("tblArhvARiM").Connect, 11)

err_Exit:
    Exit Sub

err_NoTable:
    If Not errSt = Null Or Not errSt = "" Then
        tblSt = Split(errSt, "'")
        Me.LOzorilo.Caption = "Table '" & tblSt(1) & "' does not exist!"
    End If
    Debug.Print "[No Table]" & errSt
    Exit Sub
    
err_NoFile:
    Me.LOzorilo.Caption = "File does not exist!"
    Debug.Print "[No File]" & errSt
    Exit Sub

err_Handler:
    
    If Err.Number = 3078 Then 
        errSt = Err.Description
        Resume err_NoTable
    End If
    If Err.Number = 3024 Then 
        errSt = Err.Description
        Resume err_NoFile
    End If
    
    MsgBox Err.Number & " - " & Err.Description
    Resume err_Exit
End Sub

Thats the responce i get in Immediate window:
Code:
[Start Link];DATABASE=P:\H12\I&C\ECIA.mdb
[No File]Could not find file 'C:\Documents and Settings\SH\My Documents\EIiC\ECIA.mdb'.

Does anyone have an idea why for some reason this code does not work? And the strangest think is that at the start i get debuge.print with the link that should work and with the second debug.print i get some old link(the link where i write/test my DB).
 
have you stepped through the code to see where the error is being generated?
Are you sure that all of the tables have been linked to your new location?

Peter
 
I put those debug lines in to see what is goin on and thats it. Now im lost..dont know where the problem is:confused:

And yes all 3 tables are linked to a new locations...

:confused: :( anyone ?
 
What happends if you try this syntax?
LinkSt = DLookup("[Nazv]", "tblArhvOpir")
 
Like the title of this post...strange...

It was true only one table was reconnected and thats why the problem started. But when i check it for the first time it looks like all get reconnected.

So bat17 you wore right..sorry;)

The point is ... now everythink works just as i want it...thx guys!
 

Users who are viewing this thread

Back
Top Bottom