473,403 Members | 2,366 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,403 software developers and data experts.

Question: best way to solve this little problem?? (A bit long)

Hi there
I have an audit table which sequentially logs all activity against a
device. A read operation is made up of a batch of (usually) three audit
records thusly:
Record 1 - Open
Record 2 - Read position xxx
Record 3 - Close

Similiarly a write operation is made up a batch of three audit records:
Record 1 - Open
Record 2 - Write position xxx
Record 3 - Close

There an be up to two reads/writes in the same audit batch but only
count as 1 for reporting purposes.
There are a number of other operation types which generate the same or
a similiar audit record batch group

Sometimes however the process will cancel before read or write so that
I have two batch records
Record 1 - Open
Record 2 - Close

These are the ones I am really interested in tracking in a summary
report i.e. for any date how many cancels were there. Nothing directly
indicates a cancellation, it can only be implied because there is no
audit record between the open and close audit records. Therefore I plan
to add a new field to the audit table and set its value to what kind of
batch all records belonging to the batch are i.e Read-Open
Read, Read-Close, Cancel-Open, Cancel-Close etc. That way if want a
count of all cancelled operation I just get a count of the Cancel-Open
records (see sample data below)

So what I want to do is a add a new column to the table which indicates
for the audit batch which operation type it is (for summary reports).
So some code to rip through the recordset and look at each line - no
problem. However the problem is that looking at currentrecord is no
enough to determine what type of batch it is e.g in a Cancel operation
the only way is start at the start and if currentrec.operation="open"
and currentrec+1.operation = "close" then it is a cancel batch etc etc.
1. Can does be done with a query (more of an academic question really
since I plan to write a sub to do this each night)
2. There are a lot of records each night - so I want to write an
efficient routine - what is the smartest way to code this?

If anybody has made it this far thanks a lot for your time and thanks a
lot in advance for any help that anyone can offer
Barry

Actual Sample Data (LogID is an autonumber so the records can be
sequenced in the order the events occurred) )
NEWFIELD however is an the field I wish to add with examples of the
values I wish to insert.

LogDate LogTime Client Operation
Node LogID NEWFIELD
23-Feb-06 12:13:09 $00774 OpenSession A05
33308 READ-OPEN
23-Feb-06 12:15:11 $00774 READ.:002307,Pos.:235 A05 33309 READ
23-Feb-06 12:15:16 $00774 Close Session A05 33310
READ-CLOSE

23-Feb-06 09:20:30 $01350 OpenSession A05 33304
READ-OPEN
23-Feb-06 09:20:52 $01350 READ:002409,Pos.:85 A05 33305 READ
23-Feb-06 09:21:11 $01350 READ:002472,Pos.:151 A05 33306 READ
23-Feb-06 09:21:26 $01350 Close Session A05 33307
READ-CLOSE

23-Feb-06 16:16:48 $00566 OpenSession A05 33317
WRITE-OPEN
23-Feb-06 16:17:10 $00566 WRITE:002146,Pos.:81 A05 33318 WRITE
23-Feb-06 16:17:26 $00566 Close Session A05 33319
WRITE CLOSE

23-Feb-06 18:16:22 $00558 OpenSession A05 33329
CANCEL-OPEN
23-Feb-06 18:22:34 $00558 Close Session A05 33330
CANCEL-CLOSE

23-Feb-06 09:20:30 $01350 OpenSession A05 33304
23-Feb-06 09:20:52 $01350 Return:002409,Pos.:85 A05 33305
23-Feb-06 09:21:11 $01350 Return:002472,Pos.:151 A05 33306
23-Feb-06 09:21:26 $01350 Close Session A05 33307

Aug 14 '06 #1
0 1124

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

Similar topics

2
by: baby pink | last post by:
kindly solve the problem in article one .. its quite urgent thanx for reading goog luck pink
9
by: NiQ | last post by:
Hello every one, this is about an array of string and may be have done several time before but i need it and wasnt able to find it so here is the problem i have an array of strings with contains...
1
by: Sander de Maaijer | last post by:
hello i hav a little problem this is a script calles secret word when you type the secret word you get a alert whit the text:"and this is the text of the alert wehn you know the word" butt i ...
1
by: BVM | last post by:
Hi, All: I have this error. It seems execution time is too long. Actually the execution time is about 30 seconds(I tested in Query analyzer). How do I solve this problem? ...
7
by: Mat | last post by:
I am developping multi-user windows application. i use Access database. user edit, add and delete data from database. Request: when an item is deleted ,added or modified by an user, all others...
0
jautrus
by: jautrus | last post by:
I would like to have div tag over list box, not list box over div tag. I have this problem on many pages usually when I use drop down menus. I try to solve this problem with z-index but it doesn't...
16
by: Hooyoo | last post by:
Following are similar codes of my project: At first I define two classes in two files: //ClassA.h #pragma once #include "ClassB.h" class ClassA { public: ClassA(void){};
4
by: Batmanuel | last post by:
Good evening people, little question here... I'm trying to get this file upload script to work but it tells me that move_uploaded_file() fails because it doesn't have permission for the /tmp...
2
by: davidson1 | last post by:
Hai friends....the below code is working well for sending sms from VS2008 C# windows Application...........but i want the same to work in ASP.NET(vb)............can anyone help me....I converted the...
1
by: Ryan Liu | last post by:
Hi, I have a 100 clients/ one server application, use ugly one thread pre client approach. And both side user sync I/O. I frequently see the error on server side(client side code is same, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.