|
-
September 28th, 2001, 12:02 PM
#1
deleting DataBase
I am using VB6 to maintain Access 2000 tables. I need to delete tables and repopulate them with data from our main. Our customer table is 25,000 records and the only way I have found to delete the table is to go through the records one by one and delete them. The delete process on this one table alone takes about 30 minutes.
Is there a way to copy the table setup (variables, relationships etc), delete the entire table and recreate it using the copy?
Thanks in advance.
Ray
-
September 28th, 2001, 12:13 PM
#2
Re: deleting DataBase
I can't give you an answer to the copy/create stuff, but you can delete all the records from a table using a SQL statement:
DELETE FROM myTable
DELETE * FROM myTable
If the first one (without the *) shouldn't work, use the second, but normally, it should work, and leave you with an empty table.
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
-
September 28th, 2001, 04:07 PM
#3
Re: deleting DataBase
I am using adodc and I can't find any command to execute a sql. Everything I read says db.execute, but, I can't find an execute.
It seems like I can use Delete with a filter, but, I haven't been able to figure out how to use it. The help has no examples of deleting an entire table.
I have tried:
db.filer = "DELETE * FROM mytable"
db.delete adeffectgroup
db.updatebatch
the filer statement gets an error.
Do you know how to use filer/delete.
Thanks in advance
-
September 28th, 2001, 09:00 PM
#4
Re: deleting DataBase
Can't you use SQL?
dim strSQL as string
strSQL = "DELETE * FROM YourTable"
cnYourConnection.execute strsql
It should process faster, probably less than 10 sec.
David Paulson
-
September 28th, 2001, 09:16 PM
#5
Re: deleting DataBase
With the adodc control this seems to work
Adodc1.RecordSource = "DELETE * FROM YourTable"
David Paulson
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|