Results 1 to 30 of 30

Thread: [RESOLVED] vb6 CRUD in Text File

  1. #1

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Resolved [RESOLVED] vb6 CRUD in Text File

    Hi guys, I'm developing a CRUD in VB6, but I didn't find much on google. I would like to ask for your help.

    I need your help just to diplay the items in listbox without '|' , I tried 'split' but I didn't get success.
    also I would like to select items in listbox and fill the textbox as expected.
    and I need your help because my searches getting errors.

    See img:
    Name:  Imagem1.jpg
Views: 1292
Size:  23.6 KB


    my project in attached.
    Thanks in advance. CRUD in VB6.zip

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,945

    Re: vb6 CRUD in Text File

    What code are you using?

  3. #3
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,733

    Re: vb6 CRUD in Text File

    Instead of a ListBox use the MS(H)FlexGrid.
    You can specify the numbers of rows and columns for the grid and put each value in it's own cell.

  4. #4

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Code:
    Option Explicit
    Dim way As Variant
    Dim a, X
    Public szValidPath, sName As String
    
    Public Sub Pathway(way As Variant) 'SET DATABASE FOLDER
         way = App.Path & "\data"
     
    End Sub
    Private Sub Form_Load()
    
     Call Create_Folder
     Call Add_Counter
     Call PopulateListbox
     Call Load_Combobox1
    End Sub
    
    
    Private Sub Command4_Click()
        Dim i As Long, Lindex As Long
        
        If IsArray(a) Then
            Me.List1.List = a
        Else
            Me.List1.Clear
        End If
        Lindex = Me.Combo1.ListIndex + 1
        If Lindex = 0 Then Exit Sub
        With Me.List1
            If .ListCount Then
                For i = .ListCount - 1 To 0 Step -1
                    If Val(Split(.List(i, 3), "/")(1)) <> Lindex Then .RemoveItem i
                Next
            End If
        End With
    End Sub
    
    
    
    
    Private Sub Load_Combobox1()
    
        With Combo1
            .AddItem "01 - January"
            .AddItem "02 - February"
            .AddItem "03 - March"
            .AddItem "04 - April"
            .AddItem "05 - May"
            .AddItem "06 - June"
            .AddItem "07 - July"
            .AddItem "08 - August"
            .AddItem "09 - September"
            .AddItem "10 - October"
            .AddItem "11 - November"
            .AddItem "12 - December"
        End With
    End Sub
    
    Private Sub Command3_Click() 'DELETE BUTTON
    
    Call DeleteData
    Call PopulateListbox
    
    End Sub
    Private Sub DeleteData() ' DELETE
    
      Call Pathway(way) 'SET FOLDER WAY
        Dim i As Long, ii As Long, n As Long, txt As String
        If Me.List1.ListIndex = -1 Then Exit Sub
        X(Me.List1.ListIndex) = Chr(1)
        X = Filter(X, Chr(2), 0)
        If UBound(X) > -1 Then
            txt = Join(X, vbNewLine)
        Else
            X = Empty
        End If
        Open (way & "\users.txt") For Output As #1
            Print #1, txt;
        Close #1
        Call PopulateListbox
    End Sub
    
    
    Private Sub List1_Click() 'LOAD INFORMATIONS IN TEXTBOX ABOUT THE REMITTEE
    
            Text1.Text = List1.List(0)
            Text2.Text = List1.List(1)
            Text3.Text = List1.List(2)
            Text4.Text = List1.List(3)
        
    
    End Sub
    Private Sub PopulateListbox()
      Call Pathway(way) 'SET FOLDER WAY
      List1.Clear
      
    Dim fNum As Integer
    Dim sInput As String
    Dim iInd As Integer
        'To load the ListBox from file:
        fNum = FreeFile
        'List1.Clear
        Open way & "\users.txt" For Input As #fNum
        Do Until EOF(fNum)
            Input #fNum, sInput
            List1.AddItem sInput
        Loop
        Close #fNum
    
    End Sub
    
    Private Sub Create_Folder()  'CREATE FOLDER
    
      Call Pathway(way) 'SET FOLDER WAY
      Dim CheckFolder As String
         CheckFolder = way
        If Dir(CheckFolder, vbDirectory) = "" Then MkDir CheckFolder
      Call Check_UsersTXT
    End Sub
    
    Private Sub Check_UsersTXT()  'CHECK FILE USERS
    Call Pathway(way) 'SET FOLDER WAY
    Dim strPath As Variant
    Dim strCheck As String
        'Arquivo que verificaremos
    strPath = way & "\users.txt"
        If Dir(strPath) = vbNullString Then
            strCheck = False
                 Call Create_UserTXT       'if the file NO exist do it.
        Else
            strCheck = True
                      'if the file exist do it. Nothing
        End If
    End Sub
    
    Private Sub Create_UserTXT()    'CREATE FILE USER
    Call Pathway(way) 'SET FOLDER WAY
    Dim f As Integer
    f = FreeFile
    Open way & "\users.txt" For Output As #f
    Close #f
    End Sub
    
    
    Private Sub Command1_Click()
    Call Pathway(way) 'SET FOLDER WAY
    'Open way & "\users.txt" For Output As #1
    'Print #1, Text1.Text & "," & Text2.Text & "," & Text3.Text
    'Close #1
    'Call PopulateListbox
    Call Add_Counter
                SaveInfo VBA.Trim(Text1.Text) & "|" & VBA.Trim(Text2.Text) & "|" & VBA.Trim(Text3.Text) & "|" & VBA.Trim(Text4.Text)
                
     Call PopulateListbox
     Call Clear_Fields
     Call Add_Counter
    End Sub
    Private Sub SaveInfo(LogMessage As String) 'SAVE DATA
    
        Dim LogFileName As String
        Dim FileNum As Integer
    
        Call Pathway(way) ''''SET FOLDER WAY
        LogFileName = way & "\users.txt"   'Set file name
        
        If Dir(LogFileName, vbNormal) <> "" Then                                'If the file does not
            If FileLen(LogFileName) Then LogMessage = vbNewLine & LogMessage    'exist, the same file is
        End If                                                                  'created
        FileNum = FreeFile
        Open LogFileName For Append As #FileNum
            Print #FileNum, LogMessage;
        Close #FileNum
        
    End Sub
    Private Sub Add_Counter() 'ADD COUNTER
    
        Call Check_UsersTXT
        Dim FileName As String
        Dim FileNum As Integer
        Dim Arr() As Variant
        Dim r As Long
        Dim data As String
        ''   *** Change path and file name to suit ***
        Call Pathway(way) 'SET FOLDER WAY
        FileName = way & "\users.txt"
        FileNum = FreeFile
        r = 1
        Open FileName For Input As #FileNum
        Do While Not EOF(FileNum)
            Line Input #FileNum, data
            ReDim Preserve Arr(1 To r)
            Arr(r) = data
            r = r + 1
        Loop
        Close #FileNum
        If FileLen(FileName) <> 0 Then           'TEST IF BLANK TXT FILE
            Text1.Text = Split(Arr(UBound(Arr)), "|")(0) + 1
            Else
            Text1.Text = 1
       End If
    
    End Sub
    Private Sub Command2_Click()
    
    Call TextFile_FindReplace
    Call PopulateListbox
    End Sub
    
    Private Sub TextFile_FindReplace()  'REPLACE DATA
    
        Dim valores() As String, linha As String, X As String, ID As String, NewName As String, NewAddress As String, NewBirthday As String
        
        ID = Text1.Text
        NewName = Text2.Text
        NewAddress = Text3.Text
        NewBirthday = Text4.Text
    
    
        Call Pathway(way) 'SET FOLDER WAY
        
        Open (way & "\users.txt") For Input As #1
            Do While EOF(1) = False
                Line Input #1, linha
                If linha <> "" Then
                    valores = Split(linha, "|")
                    If valores(0) = UCase(ID) Then
                        valores(1) = NewName
                        valores(2) = NewAddress
                        valores(3) = NewBirthday
                        linha = Join(valores, "|")
    
                    End If
                            If X <> "" Then
                                X = X + vbNewLine + linha
                            Else
                                X = X + linha
                            End If
                End If
            Loop
        Close #1
        Open (way & "\users.txt") For Output As #1
            Print #1, X;
        Close #1
        
    End Sub
    
    Private Sub Clear_Fields()
    
     Text1.Text = ""
      Text2.Text = ""
       Text3.Text = ""
        Text4.Text = ""
    End Sub
    Private Sub Text4_KeyPress(KeyAscii As Integer) 'TEXTBOX FOR DATE
    
        Text4.MaxLength = 10 '10/10/2017
         Select Case KeyAscii
              Case 8       'Accept o BACK SPACE
              Case 13: SendKeys "{TAB}"    'Emula o TAB
              Case 48 To 57
                 If Text4.SelStart = 2 Then Text4.SelText = "/"
                 If Text4.SelStart = 5 Then Text4.SelText = "/"
              Case Else: KeyAscii = 0     'Ignore others caracters
           End Select
      End Sub
    
    
    Private Sub Text5_Change() 'TEXTBOX FOR SEARCH IN LISTBOX
    Dim i As Long
        Dim sFind As String
         
        sFind = Me.Text5.Text
    If Text5.Text = "" Then Exit Sub
        If Len(sFind) = 0 Then
            Me.List1.ListIndex = -1
            Me.List1.TopIndex = 0
        Else
            For i = 0 To Me.List1.ListCount - 1
                If InStr(UCase(List1.List(i, 1)), UCase(sFind)) > 0 Then
                    Me.List1.TopIndex = i
                    Me.List1.ListIndex = i
                    Exit For
                End If
            Next i
        End If
    
    End Sub
    Last edited by willianrc; Nov 21st, 2022 at 10:28 AM.

  5. #5

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Quote Originally Posted by Arnoutdv View Post
    Instead of a ListBox use the MS(H)FlexGrid.
    You can specify the numbers of rows and columns for the grid and put each value in it's own cell.
    I will try with Listview, to see

  6. #6
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,261

    Re: vb6 CRUD in Text File

    If he‘s using Textfiles (why not a Database?), why in blazes isn‘t he using one of those gazillion CSV-Classes/Parsers you can find on the net?

    EDIT: or use ADO (or was it DAO?) with Textdriver.
    Last edited by Zvoni; Tomorrow at 31:69 PM.
    ----------------------------------------------------------------------------------------

    One System to rule them all, One Code to find them,
    One IDE to bring them all, and to the Framework bind them,
    in the Land of Redmond, where the Windows lie
    ---------------------------------------------------------------------------------
    People call me crazy because i'm jumping out of perfectly fine airplanes.
    ---------------------------------------------------------------------------------
    Code is like a joke: If you have to explain it, it's bad

  7. #7
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    is your textfile in the zip file?
    Sam I am (as well as Confused at times).

  8. #8

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Quote Originally Posted by SamOscarBrown View Post
    is your textfile in the zip file?
    yes. it is

  9. #9
    Hyperactive Member
    Join Date
    Feb 2015
    Posts
    316

    Re: vb6 CRUD in Text File

    Modified project attached, should do what you need. New code is commented. Hope this helps


    EDIT: I didn't fix the search, I'm at work and out of time for now.....
    Attached Files Attached Files
    Last edited by SomeYguy; Nov 22nd, 2022 at 10:32 AM.

  10. #10

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Quote Originally Posted by SomeYguy View Post
    Modified project attached, should do what you need. New code is commented. Hope this helps


    EDIT: I didn't fix the search, I'm at work and out of time for now.....
    great job. more people like you in the world

    do you know how can I separate in columns ?

    Code:
            '- Add to listbox
            List1.AddItem strList  'sInput
         '-======================
    because the Delete button got message 'Mismatch' I think it's because it expecting a number and I m passing a text.

    thanks in advance

  11. #11
    Hyperactive Member
    Join Date
    Feb 2015
    Posts
    316

    Re: vb6 CRUD in Text File

    Quote Originally Posted by willianrc View Post
    great job. more people like you in the world

    do you know how can I separate in columns ?

    thanks in advance
    For columns, probably best to use a good grid control rather than a listbox such as this one by LeandroA here:

    https://www.vbforums.com/showthread....530-ucGridPlus

    I'll look at the delete code when I get a chance.

  12. #12
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    Here is AN example using a database...simple to implement.
    (NOTE---I did not include a number of checks that you should to make sure users enter data correctly....!)

    CRUD Example --SAM.zip
    Attached Images Attached Images  
    Sam I am (as well as Confused at times).

  13. #13

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Quote Originally Posted by SamOscarBrown View Post
    Here is AN example using a database...simple to implement.
    (NOTE---I did not include a number of checks that you should to make sure users enter data correctly....!)

    CRUD Example --SAM.zip
    I couldn't run your example, maybe because I don't have any references.

    'note:
    'Added Reference to Microsoft ActiveX Data Objects 2.8 Library
    'Added MSFlexGrid Control
    'Added DTPicker Control

  14. #14
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    You know how to add References and Controls?

    If not, For References:

    (Main Menu) Select Project, then References. Then FIND the one I added...add it.

    For Controls, Right-Mouse on the Toolbox (If not visible, go to View, then ToolBox);
    Select "Components".
    From the popup list select "Microsoft FlexGrid Control 6.0"
    From the same list, select "Microsoft Windows Common Controls-2.60"
    Click OK

    You will now see the icons in the ToolBox for the Flexgrid control and the DTPicker Control.

    Add them to the form if not already there. (If you are using MY example, they should be there.---and, I set the FlexGrid Control's name to "Grid1", and set number of rows to 0 and number of columns to 4. In addition, I set FixedCols and FixedRows to 0.
    Sam I am (as well as Confused at times).

  15. #15
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    Re: vb6 CRUD in Text File

    Quote Originally Posted by willianrc View Post
    I couldn't run your example, maybe because I don't have any references.
    Sam made the mistake, to base the whole thing on a DBFile in "AccDB"-Format -
    (which - other than the Jet-Engines *.mdbs - are not supported "out-of-the-box" on current Win-OS')

    I've re-worked Sams example-code a bit (changing to the Jet-Engine and Krools VBFlexGrid) -
    and uploaded it into the CodeBank: https://www.vbforums.com/showthread....gine-CRUD-Demo

    HTH

    Olaf

  16. #16
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    @Olaf...

    Sam made the mistake, to base the whole thing on a DBFile in "AccDB"-Format -
    (which - other than the Jet-Engines *.mdbs - are not supported "out-of-the-box" on current Win-OS')

    What do you mean? (I'm a little slow on the uptake.)

    Are you saying that the little sample I provided will not run on Win11? (Meaning, unless Access is installed, it won't work?)

    Sam

    Sam I am (as well as Confused at times).

  17. #17
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    Deleted Post....sorry.
    Last edited by SamOscarBrown; Nov 26th, 2022 at 02:31 PM.
    Sam I am (as well as Confused at times).

  18. #18
    Member
    Join Date
    Jul 2020
    Posts
    38

    Re: vb6 CRUD in Text File

    My attempt

    Wish this project will be useful to you, willianrc.
    See ya
    Attached Images Attached Images  
    Attached Files Attached Files

  19. #19

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Hey Urbin,
    -I opened your project, and it's AWESOME . but I noticed that the add routine is not adding to the txt file only in listbox.
    -I also noticed that you add values to the txt file on a line by line basis for each value.
    -and this my project i have to follow pattern: [value][delimiter][value][delimiter][value] in txt file. because the other software reads this pattern.

    but i really appreciate your help. more people like you in the world.

  20. #20

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Hi guys,
    I changed my lisbox for Listview . My routines are working except Delete and Search , I got some errors. Can anyone help me with routines Delete and Search ?

    Code:
    Private Sub Command4_Click() 'SEARCH BUTTON
    
        Dim i As Long, Lindex As Long
        
        If IsArray(a) Then
            Me.ListView1.ListItems = a
        Else
            Me.ListView1.ListItems.Clear
        End If
        Lindex = Me.Combo1.ListIndex + 1
        If Lindex = 0 Then Exit Sub
        With Me.ListView1
            If .ListItems Then
                For i = .ListItems - 1 To 0 Step -1
                   If Val(Split(.List(i, 3), "/")(1)) <> Lindex Then .RemoveItem i
                Next
            End If
        End With
    End Sub
    Code:
    Private Sub DeleteData() ' DELETE DATA
    
      Call Pathway(way) 'SET FOLDER WAY
        Dim i As Long, ii As Long, n As Long, txt As String
        If Me.ListView1.ListIndex = -1 Then Exit Sub
        X(Me.ListView1.ListIndex) = Chr(1)
        X = Filter(X, Chr(2), 0)
        If UBound(X) > -1 Then
            txt = Join(X, vbNewLine)
        Else
            X = Empty
        End If
        Open (way & "\users.txt") For Output As #1
            Print #1, txt;
        Close #1
    
        Call PopulateListview
    End Sub
    See my project attached.

    listview read txt.zip

  21. #21
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    you didn't get this error when running your program?????

    See what it is telling you.....

    Name:  cruderror.JPG
Views: 974
Size:  37.7 KB

    And why are you insisting on using flat files???? A database (of some sort) would make a WHOLE LOT MORE sense.

    Sammi
    Sam I am (as well as Confused at times).

  22. #22
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    OH, and another thing...you are not using Option Explicit (at top of form code)... if you were, you would see a WHOLE BUNCH OF errors that you must/should fix.

    EDIT: You REALLY ought to look at Olaf Schmidt's link to the codebank...his demo is great!
    Sam I am (as well as Confused at times).

  23. #23

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Quote Originally Posted by SamOscarBrown View Post
    OH, and another thing...you are not using Option Explicit (at top of form code)... if you were, you would see a WHOLE BUNCH OF errors that you must/should fix.

    EDIT: You REALLY ought to look at Olaf Schmidt's link to the codebank...his demo is great!


    hi SamOscarBrown,
    I don't know if you read my message above but I will tell you:
    this my project i have to follow pattern: [value][delimiter][value][delimiter][value] in txt file. BECAUSE the OTHER SOFTWARE reads this pattern.

    I got some errors that means I dont have enough knowlodge to fix it , otherwise if I knew how to fix it I would not open this post. also I'm still learning , I m not professional coder. please dont judge me and try to help me otherwise you gonna get me frustrated.
    do not get me wrong please.

  24. #24
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    not judging you at all...we all started anew once. And ONE thing you really should do is use Option Explicit. To make it DEFAULT in a new project, go to Tools, Options, Check the option to "Require Variable Declaration" under the Editor Tab. Restart your program. That will place the words Option Explicit (meaning, Option Explicit ON) at the top of every new form/module/etc. This allows VB6 to identify several errors if you don't declare variables (etc) before you use them. Go ahead on your project, and do that, then run the project and see if you can fix most of your errors before you repost your project. We are here to help, but if you want to ignore our advice (like the good advice Olaf provided), then so be it...but you won't learn anywhere near as fast if you simply continue to 'to things your way'.

    Sam

    PS--buy and read a book about VB6 programming...Also, extensively use your MSDN (that is the "HELP" for VB).
    Sam I am (as well as Confused at times).

  25. #25
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    Re: vb6 CRUD in Text File

    Quote Originally Posted by willianrc View Post
    ...i have to follow pattern:
    [value][delimiter][value][delimiter][value] in txt file.
    BECAUSE the OTHER SOFTWARE reads this pattern.
    Well, from the Jet/ADO-Demo I've posted into the Codebank,
    you can export such a String-Format at any time with a one-liner:

    Rs.Clone.GetString(, , ",") '<- free choice of the Column-Delimiter

    Just add the following into the Demo-Form to check it out:
    Code:
    Private Sub Form_Click()
        MsgBox Rs.Clone.GetString(, , ",")
    End Sub
    All that remains is (I leave that as "homework"), to replace the MsgBox-term above with your own:
    WriteStringToTextFile Rs.Clone.GetString(, , ",") , YourFileName
    ...routine.

    Olaf

  26. #26
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    okay...so you insist on that funky textfile .... try this convoluted (but works) program (I left the DB stuff in there but commented it out---well, most of it).

    CRUD Example-withTextFile.zip

    Sam
    Last edited by SamOscarBrown; Nov 29th, 2022 at 08:10 PM.
    Sam I am (as well as Confused at times).

  27. #27
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: vb6 CRUD in Text File

    BUT...if you really want a much, much better solution (and you still want to use that file of yours), use what Olaf posted. All you would have to do is load that file into the table in the database...do all the stuff you want with the grid (CRUD), and after each 'event', simply save what is in the database (or the grid) back to a file...I THINK you were able to import your file to a listview or listbox, and export it from there as well...you can simply do the same into and out of a database table.

    Anyway...think I am out of here...been playing around with this WAY to long...Good Luck.
    Sam I am (as well as Confused at times).

  28. #28
    Member
    Join Date
    Jul 2020
    Posts
    38

    Re: vb6 CRUD in Text File

    Quote Originally Posted by willianrc View Post
    Hey Urbin,
    -I opened your project, and it's AWESOME . but I noticed that the add routine is not adding to the txt file only in listbox.
    Hi, willianrc.
    That's because it's something weird to be saving a file each time a new item it's added. It's not good for an SSD to be writing small pieces of data all the time.

    A better way it's clicking the File Menu > Save option when it's necessary.

    Quote Originally Posted by willianrc View Post
    -I also noticed that you add values to the txt file on a line by line basis for each value.
    Yeah! Because this is a better way to save the information of each Item and later read it back. In that way, you wouldn't need to worry about the Delimiters of each String of data.

    Quote Originally Posted by willianrc View Post
    -and this my project i have to follow pattern: [value][delimiter][value][delimiter][value] in txt file. because the other software reads this pattern.
    Oh! I'm sorry. I'm going to pay more attention next time.
    Look; this is my second attempt. I think now it's more closely to what you needed.

    Quote Originally Posted by willianrc View Post
    but i really appreciate your help. more people like you in the world.
    Thank you! You make me happy.

    See ya!
    Attached Images Attached Images  
    Attached Files Attached Files

  29. #29

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Quote Originally Posted by Urbin View Post
    Hi, willianrc.
    That's because it's something weird to be saving a file each time a new item it's added. It's not good for an SSD to be writing small pieces of data all the time.

    A better way it's clicking the File Menu > Save option when it's necessary.



    Yeah! Because this is a better way to save the information of each Item and later read it back. In that way, you wouldn't need to worry about the Delimiters of each String of data.



    Oh! I'm sorry. I'm going to pay more attention next time.
    Look; this is my second attempt. I think now it's more closely to what you needed.



    Thank you! You make me happy.

    See ya!
    Hey Urbin , you're master man!!!

    This is more than I expected. hahaha
    I m really happy now, but would share mine as well, Of course yours turned out much better than mine.
    See attached.

    Thanks for all cooperations

    Name:  Imagem1.jpg
Views: 828
Size:  24.4 KB

    ListView Project.zip

  30. #30

    Thread Starter
    New Member willianrc's Avatar
    Join Date
    Dec 2019
    Posts
    14

    Re: vb6 CRUD in Text File

    Quote Originally Posted by Urbin View Post
    Hi, willianrc.
    That's because it's something weird to be saving a file each time a new item it's added. It's not good for an SSD to be writing small pieces of data all the time.

    A better way it's clicking the File Menu > Save option when it's necessary.



    Yeah! Because this is a better way to save the information of each Item and later read it back. In that way, you wouldn't need to worry about the Delimiters of each String of data.



    Oh! I'm sorry. I'm going to pay more attention next time.
    Look; this is my second attempt. I think now it's more closely to what you needed.



    Thank you! You make me happy.

    See ya!
    Hiii Supreme Urbin,
    do you know how to separate your project in Columns like this? :

    Name:  m1Die.jpg
Views: 813
Size:  18.0 KB

    reference link : https://stackoverflow.com/questions/...istbox-vba-vb6

    Cheers

Tags for this Thread

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