Results 1 to 8 of 8

Thread: Edit/Update csv file

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    23

    Edit/Update csv file

    hi. I'm new here.
    just want to ask if there's away to edit/update a csv file record.
    I'm using ODBC Text File Driver. I've read it only supports Insert.
    Are there other ways to do this?

    thanks in advance.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Edit/Update csv file

    Moved From The CodeBank

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Edit/Update csv file

    Why not just use the basic File I/O?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Edit/Update csv file

    You should be able to update... what's not allowed is delete. What error messages are you getting and whats your code?

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    23

    Re: Edit/Update csv file

    Hi. thanks for the reply.
    this is the error that I'm getting when I try to update:
    Connectivity error: [Microsoft][ODBC Text Driver] Updating data in an attached (or linked) table not supported by this ISAM.

    this is my update code:
    If RS_TimeOut.RecordCount > 0 Then
    RS_TimeOut.MoveFirst
    RS_TimeOut!out_hh = IntOutH
    RS_TimeOut!out_mi = strTMi
    RS_TimeOut!kintai_status = Val(tmpKintaiStatus) + Val(updKinStat)
    RS_TimeOut!out_db_dh = Date & " " & Time
    RS_TimeOut!upd_dh = Date & " " & Time
    RS_TimeOut!edit_flg = "1"
    RS_TimeOut.Update
    End If

    thanks in advance!

  6. #6
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Edit/Update csv file

    What's your connection string?

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Mar 2007
    Posts
    23

    Re: Edit/Update csv file

    hi. this is my connection string.

    Driver={Microsoft Text Driver (*.txt; *.csv)};};Dbq=c:\Program Files\Microsoft Visual Studio\VB98\syain_login1\Data\;Extensions=asc,csv,tab,txt;

    hope you can help me out.
    thanks.

  8. #8
    PowerPoster
    Join Date
    Nov 2002
    Location
    Manila
    Posts
    7,629

    Re: Edit/Update csv file

    I stand corrected, it seems update isn't possible on a linked text file.

    If you don't want to perform file I/O as suggested earlier, you can use excel automation and work with the csv as a worksheet. There may be other alternatives, we'll have to wait for others to give their own suggestions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width