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?
mathivAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mathivAuthor Commented:
Adjusted points to 300
0
dtomynCommented:
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
            tdfTemp.RefreshLink
        End If
    Next tdfTemp
    Exit Sub
errhandler:
    MsgBox "Problems were encountered while relinking the SQL Server tables." & _
        vbCrLf & vbCrLf & _
        "Please contact your system administrator.", vbCritical, _
        "Unable to Relink Tables"
    DoCmd.Quit
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"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mathivAuthor Commented:
Hi,
 Code above works fine. Thankyou for your help.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.