Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Any tips on Linking an Array and a Random access file ?

Status
Not open for further replies.

Collin

Programmer
Jul 18, 1999
46
0
0
US
I'am trying to get the same kind of functionality of a Database without the overhead of the Jet engine, basicaly,<br>
Add a new record, Edit a record and Delete a record, Add and Edit are pretty straight forward but Delete is giving me some problems; What I came up with was to copy the array into a temporary array, redimensioned minus the record to be deleted, then overwrite the Random access file with the temporary array, then copy it back into the orginal array. All though it works, it seems alittle messy. Does anyone know of a better way?<br>
Thanks<br>
Collin
 
I have had nothing but problems from the jet engine. If you have found a solution (even an incomplete solution) please post it. We rely on new technology.
 
This sounds like a tall order to me.<br>
<br>
I don't use the Jet engine myself - I'm an Oracle kind of chap - but people seem to use it without much bother (except Alt255 it seems &lt;grin&gt;).<br>
<br>
Re-inventing wheels is <b>very</b> time consuming. Have another look at Jet.<br>
<br>
Mike<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= > </a><br>
 
Mike, you’re right. I am probably the only person in the world who hates Jet and the thousand variants it has spawned. So what if Jet drives half of the databases in the world? That doesn’t mean we have to like it, or even need a good, rational reason for hating it. Call it unthinking prejudice, call it aggravated impatience learned from spending many minutes waiting for the engine to load on slower ‘86 class machines and then watching it crash during the first query. Call it stubborn, pig-brained, bull-headed, contrary and inefficient... call it what you will. I’d rather work with flat files any day.<br>
It’s true, computers have come a long way. Some of use refuse to forgive the early insults and go with the SQL flow. May be my loss, but I’m living with it quite well, thank you. :)<br>
<br>
And Collin, for what you are trying to do, I think you're on the right track.<br>

 
Ouch! Ow! &lt;wiping off blood&gt;<br>
<br>
I take it all back!!! LOL.<br>
<br>
Mike.<br>
<br>
P.S. I'm not much of a Jet fan myself - you notice that I use Oracle?<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href=http:// Cargill's Corporate Web Site</a><br>
 
Peace! Truce! No offense intended. If my company could afford Oracle I wouldn't be the mean-spirited old man I've become in the last year. ;~}
 
What I do is put a chr(255) a the beginning of the field and check for it when I read the file, if is Chr(255) is a deleted record. You have to make a compact function to pack the file without the deleted records, but don't have to do it all the time.<br>
Maybe is not what you wanted but is faster is you need to delete several records at once.<br>

 
Touche, Hug. I prefer chr(229) - the directory entry marker for a deleted file - but the principle is the same whether the marker is part of the &quot;Last Name&quot; field or resides in a special field to indicate record status: the record is ignored except on &quot;add record&quot; and &quot;compact database&quot; operations.
 
You can use either, the important factor is the result :)<br>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top