[AccessD] A2K:ADO Version of the following

Developer Developer at UltraDNT.com
Mon Feb 23 08:40:59 CST 2004


You need to use ADOX, which is ADO for DDL and Security.  If you have
ADO, you have ADOX.  Add the reference, and then use something like:

Public Sub DelLinkedADO()
Dim c As New ADOX.Catalog
Dim t As ADOX.Table

Set c.ActiveConnection = CurrentProject.Connection

For Each t In c.Tables
    If t.Type = "link" Then
        c.Tables.Delete t.Name
    End If
Next
End Sub

Hth,
Steve



-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren DICK
Sent: Monday, February 23, 2004 8:07 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] A2K:ADO Version of the following


Bugger

Thanks John

----- Original Message ----- 
From: "John W. Colby" <jwcolby at colbyconsulting.com>
To: "Access Developers discussion and problem solving"
<accessd at databaseadvisors.com>
Sent: Monday, February 23, 2004 10:40 PM
Subject: RE: [AccessD] A2K:ADO Version of the following


> Unfortunately all that stuff is DAO specific.  There is no (AFAIAA) 
> any equivalent in ADO.
> 
> John W. Colby
> www.ColbyConsulting.com
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Darren DICK
> Sent: Monday, February 23, 2004 5:40 AM
> To: AccessD List
> Subject: [AccessD] A2K:ADO Version of the following
> 
> 
> Hello all
> I have a nice bit of code (Thanks Deano) that drops all the linked 
> tables in a dB - cool Does anyone know the ADO version of the code 
> below?
> 
> Many thanks
> 
> Darren
> 
> """"""""""""""""""""""""""""""""""""""""""""""
>  Dim lnk As DAO.tabledef
> 
>     For Each lnk In CurrentDb.TableDefs
>         If lnk.Attributes = dbAttachedTable Then
>             CurrentDb.TableDefs.Delete lnk.Name
>         End If
>     Next
> _______________________________________________
> 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
_______________________________________________
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