Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 1st, 2006, 08:12 AM
Registered User
Join Date: Nov 2006
Location: London, , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete Data from a SQL Database using vb 2005

Im learning VB 2005

I can add data into SQL 2005 Database using VB 2005, Could you plz help me , How can I Delete data from a User Input?


txtCustID= UserInput

Waiting for reply

Reply With Quote
  #2 (permalink)  
Old December 7th, 2006, 07:28 AM
Authorized User
Join Date: Aug 2006
Location: Charlotte, NC, USA.
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubisascends

you could try running a delete query to remove the data


strQueryDelete = "DELETE [columnName] FROM [tableName] WHERE [columnName]=" & txtCustID & ";"

then just run the query in code with a button click handler.

Only two things are infinite, the universe and human stupidity, and I'm not sure about the former.
Albert Einstein
US (German-born) physicist (1879 - 1955)
Reply With Quote
  #3 (permalink)  
Old December 11th, 2006, 03:16 PM
Registered User
Join Date: Dec 2006
Location: Athens, AL, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts

As a DBA, I might also suggest using a procedure like an API that deletes the data-- that way you can code in some intellegence into the delete on the database side.

Just a thought.

The previous example would also work, of course. But you might have to check for dependant relationships (parent/child) etc that might cause errors.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Server 2005 Delete on cascade DarkForce SQL Language 0 October 11th, 2008 08:24 AM
reg conn to sql server 2005 from vb.net 2005.. veda SQL Server 2005 2 July 1st, 2008 12:16 AM
Database connection in VB 2005 atoyot VB Databases Basics 0 September 30th, 2006 10:52 PM
VB 2005 connect to server 2003 with SQL database Derek_05 Visual Basic 2005 Basics 3 September 20th, 2006 10:10 AM
How to delete data from MS Excel Workbook database swadhinm ASP.NET 1.x and 2.0 Application Design 0 June 9th, 2005 12:49 AM

All times are GMT -4. The time now is 08:49 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.