Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 June 22nd, 2003, 04:46 AM
Authorized User
 
Join Date: Jun 2003
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default how do I execute an SQL update

Hi, how do I execute an update statement in code similar to,

UPDATE mvpr SET stock = three
 
Old June 22nd, 2003, 06:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

There are several ways. Assuming you are using ADO, probably the simplest is to use the Execute method of the connection object:
Code:
Dim Sql as string
Sql="UPDATE mvpr SET stock = three"
MyConn.Execute Sql, , adCmdText Or adExecuteNoRecords
Jeff Mason
Custom Apps, Inc.
www.custom-apps.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLExpress: 1.about "Execute sql button" 2.about garaxan SQL Language 1 September 3rd, 2007 07:26 AM
execute sql fishypew SQL Server 2000 4 May 18th, 2005 09:00 AM
how can i execute SQL in UDF vinod_mnr SQL Server 2000 1 March 18th, 2005 12:51 PM
sql execute from an include. robprell PHP Databases 1 October 4th, 2004 12:28 PM





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