Locking Sequential Files in QTP - SOLVED (but not sure why)

Ohmes, Matt Matt.Ohmes@COGNOS.com
Wed, 14 Jul 1999 10:18:46 -0400


Now, take this with a grain of salt.  I'm operating on partial guesses here.

I believe the answer to you question lies in the fact that, regardless of
when you lock or write to files in QTP, all files in the entire RUN are
opened at the beginning of the RUN.  (The one exception to this is subfiles.
They are opened and closed in each Request.)

I believe QTP also looks at the file type and it's use. In your case, the
first Request only ADDed records to the file, so I believe QTP may have
opened the file for Append processing only.  

I know, I know, you then wanted to update it in the next Request, but I told
you I'm guessing. The reason I suspect this is I've had the same problem
before adding and updating Direct access files.  With indexed files QTP
opens the file for UPDATE and this works for both reading and writing.

You would have the same problem with Subfiles too, except that QTP expects
you to write to Subfiles and then read from them.  That is why they are
opened and closed in each request.

Hope that helps. :-)
Matt

Matt.Ohmes@Cognos.Com
Cognos Corporation
909 E. Las Colinas Blvd.
Suite 1900
Irving, TX  75039
214-259-6200
"Matt doesn't really know anything.  He just likes to pontificate a lot.
We refuse to acknowledge that he works for Cognos or that we have ever
met him or anyone with whom he's ever been associated.  Don't lend him
money and don't let him talk to your sister!" ;-)

-----Original Message-----
From: Terry Pickering [mailto:pickering@myself.com]
Sent: Wednesday, July 14, 1999 2:30 AM
To: powerh-l@lists.swau.edu
Subject: Re: Locking Sequential Files in QTP - SOLVED (but not sure why)


Thanks MUCH! to Murray Scholz for suggesting to add different OPEN
statements to the files. I guess I've never seen (nor had to do that) in
QTP before, only in QUICK. It works, but I don't understand why you have to
for sequential files and not for indexed files? 

Bob - care to explain to us?


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Terry Pickering        Consultant Extraordinare
Monday and Friday        Tuesday - Thursday
Portland                 Eugene
(503) 245-7178           (541) 687-3416
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.