If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
replacing a link to a SQL Server table with VBA
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 |
Thread Tools | |
Display Modes | |
|
|