473,320 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Random Access files

Is it possible for to program to access a random file at the same time and
perform actions like create a new record?

Jul 17 '05 #1
7 6989
On Mon, 7 Jun 2004 19:21:27 -0700, "Oin Zea" <Oi****@hotmail.com>
wrote:
Is it possible for to program to access a random file at the same time and
perform actions like create a new record?


Er... could you clarify your question ?
Jul 17 '05 #2

"J French" <er*****@nowhere.com> wrote in message
news:40***************@news.btclick.com...
On Mon, 7 Jun 2004 19:21:27 -0700, "Oin Zea" <Oi****@hotmail.com>
wrote:
Is it possible for to program to access a random file at the same time andperform actions like create a new record?


Er... could you clarify your question ?


I think the OP is asking:

Can two programs or users open the same file For Random access at the
same time, and both perform write and append operations?

If so, I think the answer is yes, but I don't have any experience with
this.
Jul 17 '05 #3
On Mon, 7 Jun 2004 22:12:15 -0700, "Steve Gerrard"
<no*************@comcast.net> wrote:

"J French" <er*****@nowhere.com> wrote in message
news:40***************@news.btclick.com...
On Mon, 7 Jun 2004 19:21:27 -0700, "Oin Zea" <Oi****@hotmail.com>
wrote:
>Is it possible for to program to access a random file at the sametime and >perform actions like create a new record?


Er... could you clarify your question ?


I think the OP is asking:

Can two programs or users open the same file For Random access at the
same time, and both perform write and append operations?

If so, I think the answer is yes, but I don't have any experience with
this.


Ah - thanks Steve - I was genuinely bemused

Yes, two Apps can attack the same Random Access file at the same time.
They can both increase its length, but I would be very wary of doing
this as I am pretty sure that the LOF() function of one instance will
not know what the other instance has been up to.

Years ago I did a load of tests on this on a Novel network and found
that sometimes adjacent records got overwritten, also about eight
hours after running the tests, the Network would crash horribly.

The APIs still support locking ranges/regions of a File.

If I had to do this, then I would use a pre-extended file and have a
kind of 'logical' locking system in the first few records.
Jul 17 '05 #4
So I French, what will you suggest me do? what I need done is for 3 to 4
computers to access a client file in real-time. all pc can create, edit, and
delete clients from that file.

"J French" <er*****@nowhere.com> wrote in message
news:40***************@news.btclick.com...
On Mon, 7 Jun 2004 22:12:15 -0700, "Steve Gerrard"
<no*************@comcast.net> wrote:

"J French" <er*****@nowhere.com> wrote in message
news:40***************@news.btclick.com...
On Mon, 7 Jun 2004 19:21:27 -0700, "Oin Zea" <Oi****@hotmail.com>
wrote:

>Is it possible for to program to access a random file at the same

time and
>perform actions like create a new record?

Er... could you clarify your question ?


I think the OP is asking:

Can two programs or users open the same file For Random access at the
same time, and both perform write and append operations?

If so, I think the answer is yes, but I don't have any experience with
this.


Ah - thanks Steve - I was genuinely bemused

Yes, two Apps can attack the same Random Access file at the same time.
They can both increase its length, but I would be very wary of doing
this as I am pretty sure that the LOF() function of one instance will
not know what the other instance has been up to.

Years ago I did a load of tests on this on a Novel network and found
that sometimes adjacent records got overwritten, also about eight
hours after running the tests, the Network would crash horribly.

The APIs still support locking ranges/regions of a File.

If I had to do this, then I would use a pre-extended file and have a
kind of 'logical' locking system in the first few records.


Jul 17 '05 #5
"Oin Zea" <Oi****@hotmail.com> wrote in message news:<tb****************@fe39.usenetserver.com>...
So I French, what will you suggest me do? what I need done is for 3 to 4
computers to access a client file in real-time. all pc can create, edit, and
delete clients from that file.


can you use a database instead of a flat file?

can you use an ActiveX EXE server on the PC with the file and call
methods in that to coordinate updating the local file?

can you implement a locking mechanism (e.g. open another file
exclusively when you want to update)?
Jul 17 '05 #6
I can use any of them, provided you tell me how. if you can.

"Bob Butler" <bu*******@earthlink.net> wrote in message
news:fa************************@posting.google.com ...
"Oin Zea" <Oi****@hotmail.com> wrote in message

news:<tb****************@fe39.usenetserver.com>...
So I French, what will you suggest me do? what I need done is for 3 to 4
computers to access a client file in real-time. all pc can create, edit, and delete clients from that file.


can you use a database instead of a flat file?

can you use an ActiveX EXE server on the PC with the file and call
methods in that to coordinate updating the local file?

can you implement a locking mechanism (e.g. open another file
exclusively when you want to update)?


Jul 17 '05 #7
On Tue, 8 Jun 2004 07:15:08 -0700, "Oin Zea" <Oi****@hotmail.com>
wrote:
So I French, what will you suggest me do? what I need done is for 3 to 4
computers to access a client file in real-time. all pc can create, edit, and
delete clients from that file.


Ok,
The really safe way is to open the file in 'lock write' mode before
every update, then close it after the update

The time hit will not be that great.

If you really want to keep the file open, then I suggest that you
pre-format it
- eg: write loads of blank records so that the file is never extended
during normal use
This means that the FAT info and the important directory info will not
change.

I would also have a status field in each record,
eg: unused, locked, etc
Also: store the update person and DateTime in each record

Then use another file that you open in deny write mode, write in the
name of the updater, then 'lock' the individual record that a user is
going to update. It then closes the deny write file.

That is what we called the 'Block-Lock' approach

The effect is that a user goes to a record and sees:
'Record XXXXX is in use by User YYYYYY'

You need to be incredibly careful when adding records, as there must
be no possibility of one user overwriting a new record.
I would do that while the system is 'Blocked'

Anyway - the general idea is that a separate file is physically locked
to act as a semaphore for all the other users.

I would suggest that you experiment with locking files and watching
multiple processes contesting for access.
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: greeningster | last post by:
I have written an application in Visual C++ for a customer but it seems to crash randomly. Could anyone give me any help on how I could track this down ? Also, there appears there might be...
3
by: Cybertof | last post by:
Hello, Is there a simple way to read a random access file that has been created with VB6 using direct writing to disk of Type....End Type structures ? I have not found this possibility in C#. ...
1
by: Patrick | last post by:
Hi, This post is the 'sequel' ;) of the "Data Oriented vs Object Oriented Design" post, but it can be read and treated apart from that one. I will just quote the beginning of my previous message...
5
by: Raterus | last post by:
I'm just throwing this error out for my sanity, I've seen posts about this, but never solutions. I'm using VS.NET 2003, Framework 1.1, and I'm getting a random error about every 1 out of 10 times...
3
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a...
13
by: Stuart | last post by:
I have converted a VB6 app to VB.NET. It's function is to generate reports from a Random Access file but the .NET version is pathetically slow compared to the VB6 version. I think I need to to...
16
by: Claudio Grondi | last post by:
I have a 250 Gbyte file (occupies the whole hard drive space) and want to change only eight bytes in this file at a given offset of appr. 200 Gbyte (all other data in that file should remain...
39
by: Alan Isaac | last post by:
This may seem very strange, but it is true. If I delete a .pyc file, my program executes with a different state! In a single directory I have module1 and module2. module1 imports random and...
5
by: Peter | last post by:
Hi I will use a Random Access File in dotnet/csharp. The file is created with Visual Basic 6 (VB6). My Problem is to find out the corresponding Types I had to use in dotnet - reading the VB6...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.