Re: Need Help deleting record from text file

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Entering data into a database will be a bit slower as it indexes the data on
entry however retrieval will be faster. So the overall difference in speed
depends on if your app does more reads than writes. The other main speed
advantage is that opening a database should be a lot faster than reading the
whole array into memory.
Having said all that you are best served by using methods you understand so
I would suggest going along with the methods Mike has suggested and then you
can get it all working with a good solid logic flow. You can then look into
databases for the next version, by then you should be confident with the
program operation so the only things to concern you would be the connection,
data entry & retrieval and a bit of simple SQL. Initially you may find that
the speed difference is tricky to ascertain, but the potential for tuning
databases, even simple Access MDBs is very surprising, and a simple MDB
should be more than adequate for your needs, bigger and better will work but
is unecessesary overkill.
At some point do learn how to interact with databases, it'll open avenues of
possibilities to your programming you may have hitherto overlooked.

Regards
Dave O.

"Mike Williams" <mikea@xxxxxxxxxxxxxxxxx> wrote in message
news:uRd$srHAIHA.3916@xxxxxxxxxxxxxxxxxxxxxxx
"Dave O." <nobody@xxxxxxxxxxx> wrote in message
news:OxQBUbFAIHA.3400@xxxxxxxxxxxxxxxxxxxxxxx

However I would strongly suggest using a database
as it will be substantially faster than a combination of
instr, huge strings and list boxes.

I certainly wouldn't suggest building huge strings or using ListBoxes
either, but neither would I suggest using a database. It is just overkill
for the task at hand and I doubt very much whether it would produce any
significant speed increase over my own suggested method of using one or
two sorted VB string arrays. I've just tested a simple binary search
algorithm on an ordered 10,000 element array of strings of random size
(around 20 to 25 characters each) and it can find any item in the array in
about 5 microseconds. That means even the brute force method of
individually testing (for example) 9,000 individual randomly ordered
strings one at a time against the ordered array of 10,000 strings will
take only about one twentieth of a second, or a tenth of a second at
worst, to peform the entire task. And to sort the 10,000 element string
array in the first place takes only about one fifth of a second. That's
hardly a significant amount of time and is certainly just a fraction of
the time taken by the code that "reads" the list of files in the directory
in the first place. Using a bloated database for such task would not
produce any significant speed increase, and it might in fact even slow it
down.

Mike




.



Relevant Pages

  • Re: [ANN] Data Source Name parser (ODBC etc.)
    ... > suggested URL-like strings describing database connections. ... > library for such strings (data source names) is now available at ... raises the exception Syntax_Error. ...
    (comp.lang.ada)
  • Question on how updates to Access tables may or may not cause the database to expand in size
    ... All strings are stored as variable length data, one byte for each actual character and one overhead byte. ... When a database is compacted and repaired, tables are written out in primary key sequence. ... I have concluded that after the compact/repair, that each table, is written in sequence, filling up 2k pages, and that tables are not generally intermixed except at the end of one table and the beginning of the next. ... then the database DOES expand in size. ...
    (comp.databases.ms-access)
  • Re: FYI: F# language moves from lab into production
    ... unpacking the metadata into a different form seems possible, ... format (basically, a windows-registery style heirarchical database), either ... based around linked-lists of nodes, key/value pairs, and interned strings). ...
    (comp.lang.misc)
  • Re: Referencing a txt file
    ... Paul Morrison wrote: ... On receiving input from a user I need to reference it to a text file to see if that entry is present in the file. ... You may want to consider using a database. ... read the entire file into an array and process through the array until 1) you get to the end or 2)you locate the requested record. ...
    (comp.lang.php)
  • Re: Japanese to Unicode characters
    ... Oracle-Rdb database; a VB application running on a Window98 Japanese PC ... store the japanese strings as Unicode. ... UniToolBox component for VB which handle the Unicode strings. ...
    (microsoft.public.sqlserver.programming)