easiest DAO database clearing method in VB6? 
Author Message
 easiest DAO database clearing method in VB6?

what is the easiest way to clear an entire DAO database in VB6?


Sat, 13 Jul 2002 03:00:00 GMT  
 easiest DAO database clearing method in VB6?
Assuming and Access MDB file, this should work for you...

Public Sub CleanMDB(ByVal DBToClear As String)
Dim db As DAO.Database
Dim tdf As TableDef

Set db = OpenDatabase(DBToClear)
For Each tdf In db.TableDefs
    If Left(tdf.Name, 4) <> "MSys" Then
        db.Execute "Delete from " & tdf.Name
    End If
Next

End Sub


Quote:

>what is the easiest way to clear an entire DAO database in VB6?



Sun, 14 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. DAO 3.5 opendatabase method and password protected Access 97 databases

2. ADO find method compare with DAO findfirst method...

3. Using VB6 and DAO to delete all relationships in an Access database

4. Repost: Using VB6 and DAO to delete all relationships in an Access database

5. VB6 DAO Data Control vis-a-vis Access 2000 database

6. Easiest way to clear a screen in BASIC

7. Seek method, Access97 database, ADO in VB6

8. This has got to be an easy one - Clearing A Date Field

9. FIND method using ADO 2.5+ VB6 and SQL database

10. How can i clear the MSHFLEXGRID without CLEAR - Como limpar a GRID sem usar CLEAR

11. DAO 3.6 vs DAO 3.5 (VB6.0 sp3)

12. Assigning a Dao.Recordset to a Datacontrol With VB6 SP4 and Dao.360

 

 
Powered by phpBB® Forum Software