PC Review


Reply
Thread Tools Rate Thread

automtic closing

 
 
klaas
Guest
Posts: n/a
 
      20th Mar 2008
Hi,
i'am writing a program in vb.net 2005 based on an access database.
Now, i want to close my program automaticly when the user is inactive to a
period of eg 10 minutes. I want to close all mine connections to the
database en quit the program.
is there a procedure to achive this or even better an example of this on
the net?

regards, Klaas


 
Reply With Quote
 
 
 
 
simon-john roberts
Guest
Posts: n/a
 
      20th Mar 2008
You will need: A timer, A method.

put together a shutdown() method that disposes of stuff (like connections)
and does a Application.exit(),
maybe a DO YOU WANT TO EXIT popup would be good 1st.

That'll do.


"klaas" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Hi,
> i'am writing a program in vb.net 2005 based on an access database.
> Now, i want to close my program automaticly when the user is inactive to a
> period of eg 10 minutes. I want to close all mine connections to the
> database en quit the program.
> is there a procedure to achive this or even better an example of this on
> the net?
>
> regards, Klaas
>


 
Reply With Quote
 
Family Tree Mike
Guest
Posts: n/a
 
      20th Mar 2008
If going this route, a method that resets the timer if there is activity
(keypress, mouse movement) will need to be added. Without this, all will
shutdown after ten minutes regardless.

"simon-john roberts" wrote:

> You will need: A timer, A method.
>
> put together a shutdown() method that disposes of stuff (like connections)
> and does a Application.exit(),
> maybe a DO YOU WANT TO EXIT popup would be good 1st.
>
> That'll do.
>
>
> "klaas" <(E-Mail Removed)> wrote in message
> news:%(E-Mail Removed)...
> > Hi,
> > i'am writing a program in vb.net 2005 based on an access database.
> > Now, i want to close my program automaticly when the user is inactive to a
> > period of eg 10 minutes. I want to close all mine connections to the
> > database en quit the program.
> > is there a procedure to achive this or even better an example of this on
> > the net?
> >
> > regards, Klaas
> >

>

 
Reply With Quote
 
Family Tree Mike
Guest
Posts: n/a
 
      20th Mar 2008
You are basically going to do what is necessary for developing a screen
saver. There should be plenty of examples of doing something similar to
this. The first I found is
http://weblogs.asp.net/jdanforth/arc...21/454219.aspx.

You will code whatever you want to do at the point where it is determined
the user is idle.

It is a much more difficult thing if you are talking about the user being
idle in your application rather than the system. For example, if your user
gets carried away writing some emails, do you consider this idle within your
application?

By the way... Why would your connections remain open if you are not using
them? They should be closed when you are through with them.


"klaas" wrote:

> Hi,
> i'am writing a program in vb.net 2005 based on an access database.
> Now, i want to close my program automaticly when the user is inactive to a
> period of eg 10 minutes. I want to close all mine connections to the
> database en quit the program.
> is there a procedure to achive this or even better an example of this on
> the net?
>
> regards, Klaas
>
>
>

 
Reply With Quote
 
klaas
Guest
Posts: n/a
 
      21st Mar 2008
hi,

thank you for your replay.
I want to close my application automaticly because some users often forget
to close the program properly and get awway and the program remains still
open with an open connection to the DB.

If it shuts down after a period of inactivaty , the connection to the DB
will close . I prefer to idlle the thime within the application.

thx, Klaas
"Family Tree Mike" <(E-Mail Removed)> schreef in
bericht news:41ED64EF-D9B0-4FC6-8B0D-(E-Mail Removed)...
> You are basically going to do what is necessary for developing a screen
> saver. There should be plenty of examples of doing something similar to
> this. The first I found is
> http://weblogs.asp.net/jdanforth/arc...21/454219.aspx.
>
> You will code whatever you want to do at the point where it is determined
> the user is idle.
>
> It is a much more difficult thing if you are talking about the user being
> idle in your application rather than the system. For example, if your
> user
> gets carried away writing some emails, do you consider this idle within
> your
> application?
>
> By the way... Why would your connections remain open if you are not using
> them? They should be closed when you are through with them.
>
>
> "klaas" wrote:
>
>> Hi,
>> i'am writing a program in vb.net 2005 based on an access database.
>> Now, i want to close my program automaticly when the user is inactive to
>> a
>> period of eg 10 minutes. I want to close all mine connections to the
>> database en quit the program.
>> is there a procedure to achive this or even better an example of this on
>> the net?
>>
>> regards, Klaas
>>
>>
>>



 
Reply With Quote
 
klaas
Guest
Posts: n/a
 
      24th Mar 2008
Hi,
i spent a lot of time on the web, but i can't figure it out by myself. i Saw
not a suitable example which i can use in my application.
A little more help will be very appreciated.

thx Klaas
"klaas" <(E-Mail Removed)> schreef in bericht
news:%(E-Mail Removed)...
> hi,
>
> thank you for your replay.
> I want to close my application automaticly because some users often forget
> to close the program properly and get awway and the program remains still
> open with an open connection to the DB.
>
> If it shuts down after a period of inactivaty , the connection to the DB
> will close . I prefer to idlle the thime within the application.
>
> thx, Klaas
> "Family Tree Mike" <(E-Mail Removed)> schreef in
> bericht news:41ED64EF-D9B0-4FC6-8B0D-(E-Mail Removed)...
>> You are basically going to do what is necessary for developing a screen
>> saver. There should be plenty of examples of doing something similar to
>> this. The first I found is
>> http://weblogs.asp.net/jdanforth/arc...21/454219.aspx.
>>
>> You will code whatever you want to do at the point where it is determined
>> the user is idle.
>>
>> It is a much more difficult thing if you are talking about the user being
>> idle in your application rather than the system. For example, if your
>> user
>> gets carried away writing some emails, do you consider this idle within
>> your
>> application?
>>
>> By the way... Why would your connections remain open if you are not
>> using
>> them? They should be closed when you are through with them.
>>
>>
>> "klaas" wrote:
>>
>>> Hi,
>>> i'am writing a program in vb.net 2005 based on an access database.
>>> Now, i want to close my program automaticly when the user is inactive to
>>> a
>>> period of eg 10 minutes. I want to close all mine connections to the
>>> database en quit the program.
>>> is there a procedure to achive this or even better an example of this
>>> on
>>> the net?
>>>
>>> regards, Klaas
>>>
>>>
>>>

>
>



 
Reply With Quote
 
klaas
Guest
Posts: n/a
 
      24th Mar 2008
hi,

i'am sorry, but i'am only a beginner. Where do i write the "global static
(shared) boolean "
I've tried to declare it above the public class of my mainform, but he
underlines allways the static as unknown.
Public Static shutdown As Boolean

Public Class frmMainform

Therefor I cannot reach the variable on antoher form.

thx Klaas
"RobinS" <(E-Mail Removed)> schreef in bericht
news:(E-Mail Removed)...
> You'll have to put timers on all your forms and check for keystrokes, etc.
> It's a lot of trouble.
>
> If what you're trying to do is be able to kick the users out of their
> application so they no longer have the shared Access database locked,
> here's an alternate idea that I have used before, with much success:
>
> I had an application where my main form stayed open all the time, although
> sometimes it was hidden. It opened the connection to the database at
> startup, and closed it at shutdown.
>
> I put a timer on the main form. Every couple of minutes, the timer fired,
> and it checked to see if there was a file called shutdown.txt in the same
> folder as the Access database. The contents of the folder are not
> relevant, just the presence of a file with that name.
>
> I had one global static (shared) boolean variable, let's call it
> globalShutdown. When the timer fired, if the file was found, the
> globalShutdown value was set to true.
>
> In the main form, when globalShutdown was true, it would close all of the
> forms, then close itself and the connection to the database.
>
> In each of the other forms' form_closing event, if globalShutdown was
> true, it would only close itself. I had to put that in because some of the
> forms had Exit options that would close the main form in addiiton to that
> form, which you wouldn't want to do if the form was being closed BY the
> main form.
>
> In the loops in my reports, I put in a check for globalShutdown, and when
> true, exited processing and returned to the calling form.
>
> In the calling form, after the report was finished running, it checked
> globalShutdown, and didn't continue if it was true.
>
> So when I wanted to shut people out of the database, I just put a file
> with that name in the same folder. Within a couple of minutes, everybody
> was out, whether they were sitting at their desk or not.
>
> In the main form, when it closes everything (including the link to the
> database), the last thing I would do is put up a messagebox saying the
> application was being closed because database maintenance was being
> performed. The app would sit there at the messagebox for when the user
> came back to his desk, but the app wouldn't be connected to the database.
>
> Another thing I did was when the user started up the application, before
> starting up the connection to the database, check for the file. If it's
> there, give them a message telling them it is being maintained and they
> should try again later, and exit the application.
>
> It's not as complicated as it sounds. It worked really well, without fail,
> and was a lot easier than trying to figure out how long it's been since
> the user last clicked on something or typed something in one of the
> screens. Hope this helps.
>
> RobinS.
> -------------------------------------------------------
> "klaas" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi,
>> i spent a lot of time on the web, but i can't figure it out by myself. i
>> Saw not a suitable example which i can use in my application.
>> A little more help will be very appreciated.
>>
>> thx Klaas
>> "klaas" <(E-Mail Removed)> schreef in bericht
>> news:%(E-Mail Removed)...
>>> hi,
>>>
>>> thank you for your replay.
>>> I want to close my application automaticly because some users often
>>> forget to close the program properly and get awway and the program
>>> remains still open with an open connection to the DB.
>>>
>>> If it shuts down after a period of inactivaty , the connection to the DB
>>> will close . I prefer to idlle the thime within the application.
>>>
>>> thx, Klaas
>>> "Family Tree Mike" <(E-Mail Removed)> schreef in
>>> bericht news:41ED64EF-D9B0-4FC6-8B0D-(E-Mail Removed)...
>>>> You are basically going to do what is necessary for developing a screen
>>>> saver. There should be plenty of examples of doing something similar
>>>> to
>>>> this. The first I found is
>>>> http://weblogs.asp.net/jdanforth/arc...21/454219.aspx.
>>>>
>>>> You will code whatever you want to do at the point where it is
>>>> determined
>>>> the user is idle.
>>>>
>>>> It is a much more difficult thing if you are talking about the user
>>>> being
>>>> idle in your application rather than the system. For example, if your
>>>> user
>>>> gets carried away writing some emails, do you consider this idle within
>>>> your
>>>> application?
>>>>
>>>> By the way... Why would your connections remain open if you are not
>>>> using
>>>> them? They should be closed when you are through with them.
>>>>
>>>>
>>>> "klaas" wrote:
>>>>
>>>>> Hi,
>>>>> i'am writing a program in vb.net 2005 based on an access database.
>>>>> Now, i want to close my program automaticly when the user is inactive
>>>>> to a
>>>>> period of eg 10 minutes. I want to close all mine connections to the
>>>>> database en quit the program.
>>>>> is there a procedure to achive this or even better an example of this
>>>>> on
>>>>> the net?
>>>>>
>>>>> regards, Klaas
>>>>>
>>>>>
>>>>>
>>>
>>>

>>
>>

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
automtic updates on the inbox DT Microsoft Outlook Discussion 2 10th Dec 2008 10:41 PM
Unable to turn on Automtic Updates neilols Microsoft Dot NET 1 16th Jun 2008 01:38 AM
IE6 looses automtic configuration =?Utf-8?B?c3RlZmFu?= Windows XP Internet Explorer 1 31st Mar 2007 12:27 AM
outlook automtic email address ofelia@canamimaging.com Microsoft Outlook 1 5th Oct 2004 02:27 PM
Automtic retrieval of email Paul Microsoft Outlook 0 12th Dec 2003 08:25 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:48 PM.