Refresh links to sql server 7.0 from Access

When i try to use access 97 linked table manager to refresh link with sql server 7.0, I am getting error "Invalid procedure or argument called". Is any one know about why this error comes ? Is this right way to refresh link with sql server?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

dtomynConnect With a Mentor Commented:
It is the proper way, however sometimes it hits snags.  One of them is if you have updated your MDAC so that you have a different SQL Server driver than before (or at least this has been my experience).  Try the following instead to see what happens:
Private Sub RelinkAllTables()
On Error GoTo errhandler
    Dim tdfTemp As TableDef

    For Each tdfTemp In CurrentDb.TableDefs
        If Left$(tdfTemp.Connect, 5) = "ODBC;" Then
        End If
    Next tdfTemp
    Exit Sub
    MsgBox "Problems were encountered while relinking the SQL Server tables." & _
        vbCrLf & vbCrLf & _
        "Please contact your system administrator.", vbCritical, _
        "Unable to Relink Tables"
End Sub

Or if this does not work add your new connection string after the If statement like so:
tdfTemp.Connect = "ODBC;DSN=SomeDSN;Description=SomeDescription;SERVER=SomeServer;DATABASE=SomeDatabase;Trusted_Connection=Yes"
mathivAuthor Commented:
Adjusted points to 300
mathivAuthor Commented:
 Code above works fine. Thankyou for your help.
All Courses

From novice to tech pro — start learning today.