PC Review


Reply
Thread Tools Rate Thread

>> Refresh links with SQL

 
 
=?Utf-8?B?Sm9uYXRoYW4=?=
Guest
Posts: n/a
 
      28th Feb 2006
Hi, Access 2000 linking to SQL2000.

To update database structure I have a procedure that will add columns to a
table (pass-through query).

In sql, I can see the new columns. However, in Access the new fields are not
available until using the linked table manager to refresh the links.

So, how do I use code to refresh links to a sql back end?

Any ideas or suggestions appreciated :-)

Many thanks, Jonathan
 
Reply With Quote
 
 
 
 
Dirk Goldgar
Guest
Posts: n/a
 
      28th Feb 2006
"Jonathan" <(E-Mail Removed)> wrote in message
news:6BC348F7-2ACA-41CA-BC3A-(E-Mail Removed)
> Hi, Access 2000 linking to SQL2000.
>
> To update database structure I have a procedure that will add columns
> to a table (pass-through query).
>
> In sql, I can see the new columns. However, in Access the new fields
> are not available until using the linked table manager to refresh the
> links.
>
> So, how do I use code to refresh links to a sql back end?
>
> Any ideas or suggestions appreciated :-)
>
> Many thanks, Jonathan


Have you tried calling the RefreshLink method of the DAO TableDef
object?

Dim db As DAO.Database
Dim tdf As DAO.TableDef

Set db = CurrentDb
Set tdf = db.TableDefs("MyLinkedTable")
tdf.RefreshLink

I haven't tested it, but that should work. It's possible you might have
to reassign the tabledef's .Connect property and then call .RefreshLink.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
 
 
 
=?Utf-8?B?Sm9uYXRoYW4=?=
Guest
Posts: n/a
 
      28th Feb 2006
Hi Dirk, thanks for your response.

"Dirk Goldgar" wrote:

> "Jonathan" <(E-Mail Removed)> wrote in message
> news:6BC348F7-2ACA-41CA-BC3A-(E-Mail Removed)
> > Hi, Access 2000 linking to SQL2000.
> >
> > To update database structure I have a procedure that will add columns
> > to a table (pass-through query).
> >
> > In sql, I can see the new columns. However, in Access the new fields
> > are not available until using the linked table manager to refresh the
> > links.
> >
> > So, how do I use code to refresh links to a sql back end?
> >
> > Any ideas or suggestions appreciated :-)
> >
> > Many thanks, Jonathan

>
> Have you tried calling the RefreshLink method of the DAO TableDef
> object?
>
> Dim db As DAO.Database
> Dim tdf As DAO.TableDef
>
> Set db = CurrentDb
> Set tdf = db.TableDefs("MyLinkedTable")
> tdf.RefreshLink
>
> I haven't tested it, but that should work. It's possible you might have
> to reassign the tabledef's .Connect property and then call .RefreshLink.
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>


I had tried using the refreshlinks method with the tabledef. The solution
was actually to refresh the querydefs collection.

Many thanks, Jonathan
 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      28th Feb 2006
"Jonathan" <(E-Mail Removed)> wrote in message
news:2334A639-2A34-4026-810D-(E-Mail Removed)
>
> I had tried using the refreshlinks method with the tabledef. The
> solution was actually to refresh the querydefs collection.


I'm puzzled, but maybe I misunderstood where your problem was coming
from. I'm glad you found a solution.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I refresh links from Access to Sql server via ODBC? hanski Microsoft Access Forms 1 20th Mar 2006 09:48 PM
Refresh SQL database links in Access Beatrice Microsoft Access VBA Modules 2 7th Oct 2004 05:56 AM
with back command how can I get all pages to automatically refresh (without hitting refresh button) =?Utf-8?B?dmluY2VuMTE=?= Windows XP General 1 25th Apr 2004 03:22 PM
Program Information pages: Links, Links and more Links Susan Bugher Freeware 7 18th Mar 2004 05:11 PM
refresh refresh refresh refresh JP Microsoft Powerpoint 1 15th Aug 2003 04:44 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:33 AM.