Index
2012-08-24 15:11Peter Hart : Tables left open when form closes
2012-08-24 15:55MB Software Solutions General Account : Re: Tables left open when form closes
2012-08-24 15:55Fred Taylor : Re: Tables left open when form closes
2012-08-24 16:05Eurico Chagas Filho : Re: Tables left open when form closes
2012-08-24 16:07John Weller : RE: Tables left open when form closes
2012-08-24 16:11Fred Taylor : Re: Tables left open when form closes
2012-08-24 16:28Tracy Pearson : Re: Tables left open when form closes
2012-08-24 21:37Ken Dibble : Re: Tables left open when form closes
2012-08-25 02:39Allen : RE: Tables left open when form closes
2012-08-29 10:11MB Software Solutions, LLC : Re: Tables left open when form closes
Back to top
Tables left open when form closes

Author: Peter Hart

Posted: 2012-08-24 15:11:43   Link

I have an application which uses Arg Software Ribbon bars.

When I click on an icon to open a form which needs to open a table exclusive i.e. for re-indexing. I get an error that the table is already in use. I don't get this error if either this is the first form opened or I have only opened forms that don't use that particular table.

If I open FoxPro whilst the application is open I can see which tables have been used by trying to open the tables exclusive, and the I get the error.

All the forms are based on a form class that has its datasession property set private. I thought these would automatically close any tables opened by the form as the form was closed.

Any ideas were I am going wrong?

Is it possible to run through all used work areas to see if the tables required are in use and if so close them?

T.I.A.

Peter

Peter Hart Computers

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/9C476F6427FC3547AC8BBFE5E254EC56538C4F2627@SERVER.peterhartcomput.local

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 Peter Hart
Back to top
Re: Tables left open when form closes

Author: MB Software Solutions General Account

Posted: 2012-08-24 15:55:08   Link

On Fri, August 24, 2012 4:11 pm, Peter Hart wrote:

> I have an application which uses Arg Software Ribbon bars.

>

>

> When I click on an icon to open a form which needs to open a table

> exclusive i.e. for re-indexing. I get an error that the table is already

> in use. I don't get this error if either this is the first form opened or

> I have only opened forms that don't use that particular table.

> If I open FoxPro whilst the application is open I can see which tables

> have been used by trying to open the tables exclusive, and the I get the

> error. All the forms are based on a form class that has its datasession

> property set private. I thought these would automatically close any

> tables opened by the form as the form was closed.

>

> Any ideas were I am going wrong?

>

>

> Is it possible to run through all used work areas to see if the tables

> required are in use and if so close them?

Do you have AutoCloseTables set to .T. in the DataEnvironment's

properties? Or are you not using the DE?

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/c8ff57f9a2bb7b886af0ce8e6c191c6b.squirrel@webmail.dssco.net

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 MB Software Solutions General Account
Back to top
Re: Tables left open when form closes

Author: Fred Taylor

Posted: 2012-08-24 15:55:30   Link

A private DataSession will close it's own use of a table. Are you sure

that the table wasn't already open before your private DS form ran? If the

tables were already open, the private DS will not close them, only its use

of the tables, essentially like a USE AGAIN.

Fred

On Fri, Aug 24, 2012 at 1:11 PM, Peter Hart

<PHart@peterhartcomputers.co.uk>wrote:

> I have an application which uses Arg Software Ribbon bars.

>

> When I click on an icon to open a form which needs to open a table

> exclusive i.e. for re-indexing. I get an error that the table is already in

> use. I don't get this error if either this is the first form opened or I

> have only opened forms that don't use that particular table.

> If I open FoxPro whilst the application is open I can see which tables

> have been used by trying to open the tables exclusive, and the I get the

> error.

> All the forms are based on a form class that has its datasession property

> set private. I thought these would automatically close any tables opened

> by the form as the form was closed.

>

> Any ideas were I am going wrong?

>

> Is it possible to run through all used work areas to see if the tables

> required are in use and if so close them?

>

> T.I.A.

>

> Peter

> Peter Hart Computers

>

>

>

>

> --- StripMime Report -- processed MIME parts ---

> multipart/alternative

> text/plain (text body -- kept)

> text/html

> ---

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAJCBksobY_DP614kCt3biDEZXvwpGqFVO+T5d=cwihf7NwNw6A@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 Fred Taylor
Back to top
Re: Tables left open when form closes

Author: Eurico Chagas Filho

Posted: 2012-08-24 16:05:47   Link

Don't waste time looking for the problem.

Just emit a SET Database TO and  CLOSE TABLES ALL .

After that execute your routine.

E.

>________________________________

> From: Peter Hart <PHart@peterhartcomputers.co.uk>

>To: "'profox@leafe.com'" <profox@leafe.com>

>Sent: Friday, August 24, 2012 5:11 PM

>Subject: Tables left open when form closes

>

>I have an application which uses Arg Software Ribbon bars.

>

>When I click on an icon to open a form which needs to open a table exclusive i.e. for re-indexing. I get an error that the table is already in use. I don't get this error if either this is the first form opened or I have only opened forms that don't use that particular table.

>If I open FoxPro whilst the application is open I can see which tables have been used by trying to open the tables exclusive, and the I get the error.

>All the forms are based on a form class that has its datasession property set private.  I thought these would automatically close any tables opened by the form as the form was closed.

>

>Any ideas were I am going wrong?

>

>Is it possible to run through all used work areas to see if the tables required are in use and if so close them?

>

>T.I.A.

>

>Peter

>Peter Hart Computers

>

>

>

>

>--- StripMime Report -- processed MIME parts ---

>multipart/alternative

>  text/plain (text body -- kept)

>  text/html

>---

>

>_______________________________________________

>Post Messages to: ProFox@leafe.com

>Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

>OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

>Searchable Archive: http://leafe.com/archives/search/profox

>This message: http://leafe.com/archives/byMID/profox/9C476F6427FC3547AC8BBFE5E254EC56538C4F2627@SERVER.peterhartcomput.local

>** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

>

>

>

--- StripMime Report -- processed MIME parts ---

multipart/alternative

text/plain (text body -- kept)

text/html

---

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/1345842347.81684.YahooMailNeo@web140606.mail.bf1.yahoo.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 Eurico Chagas Filho
Back to top
RE: Tables left open when form closes

Author: John Weller

Posted: 2012-08-24 16:07:46   Link

Try AUSED() to find which tables are open.

John Weller

01380 723235

07976 393631

> -----Original Message-----

> From: profoxtech-bounces@leafe.com [mailto:profoxtech-

> bounces@leafe.com] On Behalf Of Peter Hart

> Sent: 24 August 2012 21:12

> To: profoxtech@leafe.com

> Subject: Tables left open when form closes

>

> I have an application which uses Arg Software Ribbon bars.

>

> When I click on an icon to open a form which needs to open a table

exclusive

> i.e. for re-indexing. I get an error that the table is already in use. I

don't get

> this error if either this is the first form opened or I have only opened

forms

> that don't use that particular table.

> If I open FoxPro whilst the application is open I can see which tables

have

> been used by trying to open the tables exclusive, and the I get the error.

> All the forms are based on a form class that has its datasession property

set

> private. I thought these would automatically close any tables opened by

the

> form as the form was closed.

>

> Any ideas were I am going wrong?

>

> Is it possible to run through all used work areas to see if the tables

required

> are in use and if so close them?

>

> T.I.A.

>

> Peter

> Peter Hart Computers

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/000501cd823c$832bb220$89831660$@johnweller.co.uk

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 John Weller
Back to top
Re: Tables left open when form closes

Author: Fred Taylor

Posted: 2012-08-24 16:11:21   Link

AUSED() only reports on the current session if a sessionid is not

specified. In any case, it only reports on a single session.

Fred

On Fri, Aug 24, 2012 at 2:07 PM, John Weller <john@johnweller.co.uk> wrote:

> Try AUSED() to find which tables are open.

>

> John Weller

> 01380 723235

> 07976 393631

>

> > -----Original Message-----

> > From: profoxtech-bounces@leafe.com [mailto:profoxtech-

> > bounces@leafe.com] On Behalf Of Peter Hart

> > Sent: 24 August 2012 21:12

> > To: profoxtech@leafe.com

> > Subject: Tables left open when form closes

> >

> > I have an application which uses Arg Software Ribbon bars.

> >

> > When I click on an icon to open a form which needs to open a table

> exclusive

> > i.e. for re-indexing. I get an error that the table is already in use. I

> don't get

> > this error if either this is the first form opened or I have only opened

> forms

> > that don't use that particular table.

> > If I open FoxPro whilst the application is open I can see which tables

> have

> > been used by trying to open the tables exclusive, and the I get the

> error.

> > All the forms are based on a form class that has its datasession property

> set

> > private. I thought these would automatically close any tables opened by

> the

> > form as the form was closed.

> >

> > Any ideas were I am going wrong?

> >

> > Is it possible to run through all used work areas to see if the tables

> required

> > are in use and if so close them?

> >

> > T.I.A.

> >

> > Peter

> > Peter Hart Computers

>

>

[excessive quoting removed by server]

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/CAJCBksqLCBx+3tbLUJPxOmvB0F_yZQTQ21SvBerYS-yRDbpwJw@mail.gmail.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 Fred Taylor
Back to top
Re: Tables left open when form closes

Author: Tracy Pearson

Posted: 2012-08-24 16:28:42   Link

Peter Hart <PHart@peterhartcomputers.co.uk> wrote:

>I have an application which uses Arg Software Ribbon bars.

>

>When I click on an icon to open a form which needs to open a table

>exclusive i.e. for re-indexing. I get an error that the table is

>already in use. I don't get this error if either this is the first form

>opened or I have only opened forms that don't use that particular

>table.

>If I open FoxPro whilst the application is open I can see which tables

>have been used by trying to open the tables exclusive, and the I get

>the error.

>All the forms are based on a form class that has its datasession

>property set private. I thought these would automatically close any

>tables opened by the form as the form was closed.

>

>Any ideas were I am going wrong?

>

>Is it possible to run through all used work areas to see if the tables

>required are in use and if so close them?

>

>T.I.A.

>

>Peter

If you call a method of an object which was instantiated prior to the form and pass in an object of the form (form included), the form may not close the data session since an out standing reference to an object exist.

Run your exe in an open VFP session which has the data session window open. You should be able to run forms and see if the tables are opening in a private data session, our if the session gets left open.

I usually start a VFP session that has no connection to my development environment.

You can use AUSED(), you may need to use SET DATASESSION also.

--

Tracy

Sent from my Android phone with K-9 Mail.

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/04617239-f9df-4d78-8012-86f75c9020ee@email.android.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 Tracy Pearson
Back to top
Re: Tables left open when form closes

Author: Ken Dibble

Posted: 2012-08-24 21:37:15   Link

> >Is it possible to run through all used work areas to see if the tables

> >required are in use and if so close them?

> >

>You can use AUSED(), you may need to use SET DATASESSION also.

You can use ASESSIONS() to get an array of data session IDs, and then loop

through those, use AUSED() to get an array of work areas in each data

session, and close them.

But in many situations I like Eurico's suggestion better:

CLOSE TABLES ALL

CLOSE DATABASES ALL

Then

OPEN DATABASE MyDatabase

SET DATABASE TO MyDatabase

Then back to what you were doing.

Ken Dibble

www.stic-cil.org

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/5.2.1.1.1.20120824223342.01fbfe60@POP-Server.stny.rr.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 Ken Dibble
Back to top
RE: Tables left open when form closes

Author: Allen

Posted: 2012-08-25 02:39:49   Link

What is a good reason to use data sessions. I never do and never have these

problems. I prefer control

Al

-----Original Message-----

From: profoxtech-bounces@leafe.com [mailto:profoxtech-bounces@leafe.com] On

Behalf Of Fred Taylor

Sent: 24 August 2012 23:11

To: profoxtech@leafe.com

Subject: Re: Tables left open when form closes

AUSED() only reports on the current session if a sessionid is not specified.

In any case, it only reports on a single session.

Fred

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/000601cd8294$cf28a310$6d79e930$@com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 Allen
Back to top
Re: Tables left open when form closes

Author: MB Software Solutions, LLC

Posted: 2012-08-29 10:11:49   Link

On 8/25/2012 3:39 AM, Allen wrote:

> What is a good reason to use data sessions. I never do and never have these

> problems. I prefer control

For starters, you can have the same table/cursor names open so you can

code consistently moreso rather than having to create bizarre names for

your cursors so they don't collide. Think of several forms each with

their own datasession. The old Sylvan app (which kicked ass for 16+ yrs

and still does so) created bizarre cursor names and kept track of such

names in variables. Would have made life much easier if separate data

sessions were used. Debugging was many times a nightmare.

--

Mike Babcock, MCP

MB Software Solutions, LLC

President, Chief Software Architect

http://mbsoftwaresolutions.com

http://fabmate.com

http://twitter.com/mbabcock16

_______________________________________________

Post Messages to: ProFox@leafe.com

Subscription Maintenance: http://leafe.com/mailman/listinfo/profox

OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech

Searchable Archive: http://leafe.com/archives/search/profox

This message: http://leafe.com/archives/byMID/profox/503E3135.6060402@mbsoftwaresolutions.com

** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

©2012 MB Software Solutions, LLC