Results 1 to 4 of 4

Thread: Textfiles /database

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Ruinen, Drente, Netherlands
    Posts
    192
    I am not familiar with textfile or databases, so I have a question about this: I have a textfile from about 5 Mb with contains records. Now I will search in the file for certain words and if the word exist in a record then put the record and/or records in a new file or listbox. Who can help me with a example ??

  2. #2
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    I can,

    Some more info please, Is the File DB only text or does it contain binary data too? Do you know if the record size is static (so we can match it with a User Type and use random access for records) or delimited (in which case being 5mb you'd be better off with binary arrays and split functions).

    Hear from you soon

    Paul

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Apr 1999
    Location
    Ruinen, Drente, Netherlands
    Posts
    192
    Hello Paul,

    The file have no delemiters and is only text. Until now I search with a 'GREP' method, but I think it must be better with VB. A record contains:
    - number (10)
    - description (25)
    - price1 (10)
    - price2 (10)
    - info (25)
    - reserve (10)
    If you need more info you can email me: [email protected]

    regards, Kars


  4. #4
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    Well you have no problems then.

    You can check MSDN for more details under Random File Access,

    Code:
    ' Module
    
    Public Type Product
        pNumber as String * 10
        pDescription as String * 25
        pPrice1 as String * 10
        pPrice2 as String * 10
        pInfo as String * 25
        pReserve as String * 10
    End Type
    
    Public Products() as Product
    
    
    ' Form
    
    
    Open "LensenDB.Dat" for Random as #1 Len = 90
    then use Get() to get the records

    The other alternative if this is too slow because the DB is too big, load it all into a binary array and split records with mod 90




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