[AccessD] Connect String for Linked Table
Charlotte Foust
charlotte.foust at gmail.com
Fri Nov 20 17:31:07 CST 2015
The linked tables are still there, as they should be since the links are in
the front end. I used it originally to find a linked table to test in case
the hard-coded one was missing. But what's baffling me it the inconsistent
results. It should never return a false but it does! This is driving me
crazy!
My clients sometimes rename folders, which results in broken links. I've
used tests before to determine if something had broken the links so I could
prompt the user to browse to the correct folder. But in this case, it's
not happening because the routine is returning a false on a broken-linked
table.
Charlotte
Charlotte Foust
(916) 206-4336
On Fri, Nov 20, 2015 at 3:21 PM, Gustav Brock <gustav at cactus.dk> wrote:
> Hi Charlotte
>
> Oh, I thought you meant some code for relinking the tables.
>
> I'm not sure I understand how you use this function? If the backend is
> moved, the linked table objects in the frontend don't vanish.
> So what may cause your linked table objects to be deleted?
>
> /gustav
>
> ________________________________________
> Fra: AccessD <accessd-bounces at databaseadvisors.com> på vegne af Charlotte
> Foust <charlotte.foust at gmail.com>
> Sendt: 21. november 2015 00:02
> Til: Access Developers discussion and problem solving
> Emne: Re: [AccessD] Connect String for Linked Table
>
> Public Function DoesObjectExist(ByVal strObjName As String) As Boolean
> On Error Resume Next
> Dim intCnt As Integer
>
> intCnt = DCount("[Name]", "MSysObjects", "[Name] = '" & strObjName &
> "'")
> DoesObjectExist = (intCnt > 0)
> End Function
>
> this *usually* returns true for a table with a broken link. Except,
> sometimes it doesn't. It does when I call it from the immediate window,
> but when it's called from code, it may return a False. If my hair weren't
> already nearly white, it would be with this.
>
> I'm also sometimes getting "item not found in this collection" when I try
> to call the above routine from code.
>
> Charlotte
>
>
> Charlotte Foust
> (916) 206-4336
>
> On Fri, Nov 20, 2015 at 2:57 PM, Gustav Brock <gustav at cactus.dk> wrote:
>
> > Hi Charlotte
> >
> > And your code is?
> >
> > /gustav
> >
> > ________________________________________
> > Fra: AccessD <accessd-bounces at databaseadvisors.com> på vegne af
> Charlotte
> > Foust <charlotte.foust at gmail.com>
> > Sendt: 20. november 2015 23:15
> > Til: Access Developers discussion and problem solving
> > Emne: [AccessD] Connect String for Linked Table
> >
> > I'm working on a db built in 2010 on Windows 7 but I'm using 2013 on
> > Windows 10. I have code that worked just fine last year but is breaking
> > this year because suddenly, if the back end file is moved or renamed, the
> > code to set a tabledef object to the linked table in question can't find
> > the linked table. Obviously, the table still exists because the linked
> > table manager can see it, so it's still in the system tables, but the
> code
> > breaks.
> >
> > Any ideas?
> >
> > Charlotte Foust
> > (916) 206-4336
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list