ADOX not deleting on first attempt
- From: Bernard <bernard.herrok@xxxxxxxxx>
- Date: Thu, 8 May 2008 06:14:28 -0700 (PDT)
Hi group,
I'm trying to delete some tables (in my test case all tables) using
adox.
Problem is, it takes a couple of "runs" to delete all the table.
Is there a reason for this? Is there any dependencies that does not
allow the table to be deleted and if so, why don't I get an error
(even when I check ADODB.Connection.Error)?
This seems to be happening with views also.
Here's the code:
Dim catalog As ADOX.catalog
Set catalog = New ADOX.catalog
Dim table As ADOX.table
Dim tableNode As IXMLDOMNode
Dim index As ADOX.index
Dim deleteCount As Integer
' Set active ADO Connection
catalog.ActiveConnection = g_cn
'Do
'deleteCount = 0
For Each table In catalog.Tables
' Don't try to delete views or system tables
If StrComp(table.Type, "TABLE", vbTextCompare) = 0 Then
' Drop the table
catalog.Tables.Delete table.Name
'deleteCount = deleteCount + 1
End If
Next
'Loop While deleteCount > 0
.
- Follow-Ups:
- Re: ADOX not deleting on first attempt
- From: Bob Barrows [MVP]
- Re: ADOX not deleting on first attempt
- From: Stephen Howe
- Re: ADOX not deleting on first attempt
- Prev by Date: Re: Using Data Source
- Next by Date: Re: ADOX not deleting on first attempt
- Previous by thread: Using Data Source
- Next by thread: Re: ADOX not deleting on first attempt
- Index(es):
Relevant Pages
|
|