Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > Pro VB 6
|
Pro VB 6 For advanced Visual Basic coders working in version 6 (not .NET). Beginning-level questions will be redirected to other forums, including Beginning VB 6.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB 6 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 April 7th, 2006, 03:30 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to parthsar5
Default How to update or delete a row in CSV file

I am trying to delete or update a CSV file using a ADODB recoredset in VB6.0. Its giving a error multiple data can't be updated.

Actually, i am having some (around 50) records in my CSV file. I am able to add new records in the same file but not able to update nor delete the record from the CSV files. When i run this code it gives error message


objconnection active connection

strPathtoTextFile = App.Path & "\Data\"

If objconnection.State <> 0 Then Set objconnection = Nothing


objconnection.ConnectionString = _
        "Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
        "DefaultDir=" & strPathtoTextFile

objconnection.Open

Private Function deleteob()
Dim showrs As New ADODB.Recordset
Dim sqlstr As String

sqlstr = "delete from Observation.csv where ob_code=" & txtOb_code

If showrs.State <> 0 Then Set showrs = Nothing
showrs.Open sqlstr, objconnection, adOpenDynamic, adLockOptimistic
End Function


It gives error message "Delete Data in a linked table is not supported by this ISAM".







Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to delete file System.IO.Delete error maricar C# 13 March 14th, 2014 06:50 AM
update/delete fails when row contains null values davej ASP.NET 2.0 Basics 2 December 6th, 2006 03:47 PM
Parsing and Removing CSV values in row cell. peryan77 SQL Server 2000 5 February 2nd, 2006 03:48 PM
how to edit/ update records/ rows of csv file vb thePervertedMonk VB How-To 1 December 10th, 2004 02:15 PM
how to delete a row when click delete hyperlink naveenkumarg1 Pro JSP 1 August 16th, 2004 01:29 AM





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