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 August 18th, 2004, 10:50 AM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to bisigreat
Default What is the code for editing data

Hello,
I need to edit some data that is displayed on two text boxes and save after editing the data. So i wrote this lines of code
    With rsSS
        .EditMode
        rsSS!Code = txtCardCatCode.Text
        rsSS!Description = txtCardCatDesc.Text
        .Update
    End With
but is giving this error "Invalid use of Property" when it teaches .EditMode
Kindly help out





 
Old August 18th, 2004, 11:55 PM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 463
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to madhukp
Default

The usage of ADO recordset in this way is not good or efficient. You can do it in this way.

cnSS.Execute "UPDATE <tablename> SET Code='" & Replace(txtCardCatCode.Text, "'", "''") & "', Description='" & Replace(txtCardCatDesc.Text, "'", "''") & "' WHERE " & <where condition>

Where cnSS is the ADO connection object with which you open the recordset. <tablename> is the name of the table where you modify. <Where condition> is to selectively modify the records of the table. You may use the where condition you used in the select query with which you opened the recordset.
 
Old August 19th, 2004, 03:06 AM
Authorized User
 
Join Date: Aug 2004
Posts: 11
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to bisigreat
Default

Thank you,
It worked. Honestly, your responses has been an encouragement to me.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Binding - Editing GridView Row Data desk_star BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 7 December 30th, 2007 11:07 AM
Transpose Table - Editing the MS KB code gwolfe Access 2 September 14th, 2007 02:48 AM
Editing Data in a DataView thenextbillgates ASP.NET 1.0 and 1.1 Basics 3 April 10th, 2006 09:40 PM
Data Grid Editing in C# bmains C# 1 December 16th, 2004 04:23 AM
Visual Basic code for Updating (Editing) DataSet11 connijean VB Databases Basics 0 May 5th, 2004 05:53 PM





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