Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB Databases Basics
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 1st, 2006, 08:12 AM
Registered User
 
Join Date: Nov 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Delete Data from a SQL Database using vb 2005

Hi
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?

Example

txtCustID= UserInput

Waiting for reply

 
Old December 7th, 2006, 07:28 AM
Authorized User
 
Join Date: Aug 2006
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anubisascends
Default

you could try running a delete query to remove the data

example:

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)
 
Old December 11th, 2006, 03:16 PM
Registered User
 
Join Date: Dec 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.








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





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