Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Iron Speed
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old November 22nd, 2004, 11:39 AM
chuiwaucr chuiwaucr is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 chuiwaucr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 10 sec
Reputation Power: 0
How to clear/delete all data of access table by VB?

Hi all,

Please help me, how to clear/delete all data of access table when every time I hit cancel button command in VB application form and that table gonna be BLANK for next formload use.

Thank you very much,

ps: By the way, how to save time in DTPicker1 into D/T field of access table because it just show date only ? Thank in advances

Reply With Quote
  #2  
Old November 22nd, 2004, 01:39 PM
JamesLe JamesLe is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Oakland, CA, USA
Posts: 131 JamesLe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m
Reputation Power: 4
Hello chuiwaucr,

Insert this line into your Cancel button code:

DoCmd.RunSQL ("DELETE * FROM YourTableName;")

Reply With Quote
  #3  
Old November 22nd, 2004, 01:50 PM
x_c4_4u x_c4_4u is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Location: Zimbabwe
Posts: 34 x_c4_4u User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 10 m 15 sec
Reputation Power: 4
Send a message via Yahoo to x_c4_4u
its not clear (at least to me) what you want to do, are you clearing the form or are you deleting all/selected records in the database?

Reply With Quote
  #4  
Old November 22nd, 2004, 02:12 PM
chuiwaucr chuiwaucr is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 chuiwaucr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 10 sec
Reputation Power: 0
Quote:
Originally Posted by JamesLe
Hello chuiwaucr,

Insert this line into your Cancel button code:

DoCmd.RunSQL ("DELETE * FROM YourTableName;")
Hi JamesLe,

My cancel button in VB application form, when I put
DoCmd.RunSQL ("DELETE * FROM YourTableName;")

It says "variable not defined" (error highlight at DoCmd) when I compile program. Please
Help me more, I'd appreciate much.

Thanks so much JamesLe

Reply With Quote
  #5  
Old November 22nd, 2004, 02:28 PM
chuiwaucr chuiwaucr is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 chuiwaucr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 m 10 sec
Reputation Power: 0
Hi JamesLe,

I got it, thanks for your reply. By the way, how to save date and time from DTPicker of vbform into access table. Because I just save date only, I want both date and time.

thanks,

Reply With Quote
  #6  
Old November 22nd, 2004, 04:52 PM
JamesLe JamesLe is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Location: Oakland, CA, USA
Posts: 131 JamesLe User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m
Reputation Power: 4
Hello chuiwaucr,

Try:
DTPicker1.Value = Now()

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > How to clear/delete all data of access table by VB?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway