I need a code to loop in all tables of access database and delete table if existis...
Possible?
delete table if existis ado and vb6
-
- PlatinumLounger
- Posts: 4368
- Joined: 26 Apr 2010, 17:36
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: delete table if existis ado and vb6
Are there relationships with enforced referential integrity between the tables in the database?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4368
- Joined: 26 Apr 2010, 17:36
Re: delete table if existis ado and vb6
no... is sample service tableHansV wrote:Are there relationships with enforced referential integrity between the tables in the database?
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: delete table if existis ado and vb6
Do you want to delete a specific table or do you want to delete all tables?
Do you want to do this within Access or from Excel?
Do you want to do this within Access or from Excel?
Best wishes,
Hans
Hans
-
- PlatinumLounger
- Posts: 4368
- Joined: 26 Apr 2010, 17:36
Re: delete table if existis ado and vb6
one table...HansV wrote:Do you want to delete a specific table or do you want to delete all tables?
Do you want to do this within Access or from Excel?
Example:
loop in all tables in mdb access anf if MyTable exists delete it.
I need in vba for excel or vb classic.
I just have active conn on access database named CN
-
- Administrator
- Posts: 78620
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: delete table if existis ado and vb6
Try this:
On Error Resume Next
CN.Execute "DROP TABLE MyTable"
On Error GoTo 0
On Error Resume Next
CN.Execute "DROP TABLE MyTable"
On Error GoTo 0
Best wishes,
Hans
Hans