Re: Need Help deleting record from text file
- From: "Dave O." <nobody@xxxxxxxxxxx>
- Date: Thu, 27 Sep 2007 10:38:06 +0100
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
.
- Follow-Ups:
- Re: Need Help deleting record from text file
- From: Mike Williams
- Re: Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- References:
- Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- From: Dave O.
- Re: Need Help deleting record from text file
- From: David Kerber
- Re: Need Help deleting record from text file
- From: Norm
- Re: Need Help deleting record from text file
- From: Dave O.
- Re: Need Help deleting record from text file
- From: Mike Williams
- Need Help deleting record from text file
- Prev by Date: VB DataType equivalent of ADO adBigInt Type
- Next by Date: Re: Need Help deleting record from text file
- Previous by thread: Re: Need Help deleting record from text file
- Next by thread: Re: Need Help deleting record from text file
- Index(es):
Relevant Pages
|