By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,057 Members | 1,346 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,057 IT Pros & Developers. It's quick & easy.

Deleting all the records in an access table

P: 1
Hi,
I am using Vb6.0 as a front end and msaccess as the db.
i want 2 delete all the records in a table "Register" by clicking a menu
The connection is made using ADODB
Till now i hv the code

Private Sub mnudel_Click()
Docmd.SetWarnings False
Docmd.RunSql ("DELETE * FROM Register;")
Docmd.SetWarnings True
End Sub

But when i execute this a error msg displays
Run time error "424"
Object required

Whats the problem in me
plz help me to come out from this...
Dec 27 '07 #1
Share this Question
Share on Google+
2 Replies


debasisdas
Expert 5K+
P: 8,127
If you are using ADODB then try to use
Expand|Select|Wrap|Line Numbers
  1. dim con as new adodb.connection
  2.  
  3. con.begintrans
  4. con.execute "delete from Register"
  5. con.committrans
  6.  
Dec 27 '07 #2

Expert 5K+
P: 8,434
Looks like somebody has been using too much VBA. :)

I'm pretty sure there's no DoCmd object in VB6.
Dec 28 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.