07-16-2001, 09:31 AM
Another question: Is it possibly to run a macro in a database externally , ie through VB ? I'm designing an .exe through VB that copies and compacts the database, but I need to clear out the tables in the database. Currently I'm using SQL.
07-17-2001, 07:25 AM
It would be better if you connected to the database externally and cleared it after it has been copied.
dim rs as recordset
dim db as database
do while not rs.eof
if not rs.eof then rs.movelast
or something like that.
07-17-2001, 07:33 AM
Thanks for the suggestion! I used SQL statements but a loop definitely cuts down on coding!
07-17-2001, 06:14 PM
I thought clearing a table using sql statement could be simpler, why not? I will have something like this:
Dim db As Database
Dim sqlStatement As String
Set db = OpenDatabase("d:\misc\myDb.mdb")
sqlStatement = "delete * from myTable"
set db = nothing