[AccessD] Connect String for Linked Table

Stuart McLachlan stuart at lexacorp.com.pg
Fri Nov 20 17:26:43 CST 2015


I doubt that your problem les with this function.

If it returns False "when called from code", then I'd suspect that your code is deleting the 
table before this function is called.

What line is highlighted when you get the "item not found" error.

On 20 Nov 2015 at 15:02, Charlotte Foust wrote:

> 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
> >
> -- 
> 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