A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

replacing a link to a SQL Server table with VBA



 
 
Thread Tools Display Modes
  #1  
Old July 5th, 2009, 10:48 PM posted to microsoft.public.access.formscoding,microsoft.public.access.tablesdbdesign
Paul
external usenet poster
 
Posts: 126
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:08 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.