replacing a link to a SQL Server table with VBA

P

Paul

I have a link to a SQL Server table that works well when I first create it,
but after a period of an hour or so, it produces a "Connection failed"
message and "Login failed for user" (domain name/login name). So I have to
manually delete and then recreate the link.

I'm going to be talking with our SQL Server administrators to have them fix
the permissions for my account so this hopefully won't keep happening.
However, I've got links to several SQL Server tables from which my queries
update data nightly, and I'd like minimize the risk that there will be an
update failure if and when SQL Server decides to pull this stunt on one of
these tables in the future. So what I would like to do is have VBA delete
all those links to the SQL Server database and then recreate them every
night when I run the update queries.

Here are the ODBC parameters for one of the tables:

ODBC;Description=PSBCC;DRIVER=SQL Server;SERVER=SMF01MSQL005D;APP=Microsoft
Office 2003;WSID=SMF00CTRX037;DATABASE=psbcc;TABLE=dbo.t_LP_Projects

Is there a way to delete this link in VBA and then replace it with VBA, and
if so, what would the code be to accomplish this?

Thanks in advance,

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top