SunQuest
 
           Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
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:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old December 3rd, 2004, 11:26 AM
shanny shanny is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 35 shanny User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 50 sec
Reputation Power: 5
Question Delete problem

i want to delete the selected record, here is my coding, but it consist of errors. Below are my coding, what is the problem there?

response = MsgBox("You are about to delete 1 record." & vbCrLf & "If you click YES, you won't be able to undo this delete operation." & vbCrLf & "Are you sure you want to delete these record?", vbCritical + vbYesNo, "Confirm Delete")
If response = vbYes Then
Set rst = New adodb.Recordset
rst.Open "Student", db, adOpenDynamic, adLockOptimistic
rst("ID") = txtLecID.Text
rst("Name") = txtLecName.Text
rst("Address") = txtLecAdd.Text
rst("CIty") = txtCity.Text
rst("PostCode") = txtPCode.Text
rst("State") = cboState.Text
rst("Tel") = txtLecTel.Text
rst.Delete
end if


Pls advise... thanks

Reply With Quote
  #2  
Old December 3rd, 2004, 12:08 PM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 4
I always use execute:

response = MsgBox("You are about to delete 1 record." & vbCrLf & "If you click YES, you won't be able to undo this delete operation." & vbCrLf & "Are you sure you want to delete these record?", vbCritical + vbYesNo, "Confirm Delete")
If response = vbYes Then
Db.execute "Delete Student where ID='" & txtLecID.text & "'"

Reply With Quote
  #3  
Old December 4th, 2004, 10:15 AM
shanny shanny is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 35 shanny User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 50 sec
Reputation Power: 5
thanks ya... it is work! :>

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Delete problem


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 | 
  
 





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