Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ok let's put our thinking caps on-exclusive user

Status
Not open for further replies.

Scoty

Programmer
Oct 25, 2000
278
US
Hey everyone,
First I am using a97 on an nt4.0 box. Secondly, I have a program that will create a table upon open everyday. Here is the problem I would like the program to (once it realized that the daily table has not been created) switch the current user to exclusive user.

Here is what I have done so far. When the "first" user of the day opens the database. the database checks to see if the daily table already exists (of course it doesn't) so I launch a little vb program that I made it closes the database ,times for 5 seconds then re - opens the database (in exclusive mode).

So have you found my problem yet? When the database opens for the second time, it looks for the table of course it doesn't find it. Then it launches my vb program which times for 5, never mind you get the point.

What I would like to know is. Either is there a way to tell if the database has been opened exclusively or is there a way to change the shared/exclusive property on the fly?<perferred method if available

Any help would be greatly appreciated

Thanks
Scoty ::)
&quot;Learn from others' mistakes. You could not live long enough to make them all yourself.&quot;
-- Hyman George Rickover (1900-86),
 
Another approach to this would be to use a daily table log (DTL) such as that described in [COLOR=blue[u]thread705-79802[/u]][/color] if no record is found in the DTL for todays date then the table for today has not been created.

Kick off all other users and do not allow them back in (as described in the thread mentioned above.

This same method could be used with your current process by simply haveing the DTL updated when the first person opens the database....use your vb program to kick you out and open the database back up....Since the DTL is now checked as being ready to create the daily table the process will not repeat. ie have to if's....if record found in DTL then...if table found then....

You could also attach a user id to the DTL if you are worried about a different person going in in th 5 seconds that your vb code waited to re-open the database, thus only your user name can open the databse until you close it, which would triger the DTL to be updated again to allow anyone in.

kind of a backwords approach but it would work.
 
mflancour,
Thanks for your reply. Sometimes you just have to say duh! I was actually part of that post and had forgotten about it. Although it does seem like the long way to the outhouse, I believe it will work. But I would still like to know if there is anyway to shift the user to exclusive user on the fly...anyone, anyone?

Thanks
Scoty ::) &quot;Learn from others' mistakes. You could not live long enough to make them all yourself.&quot;
-- Hyman George Rickover (1900-86),
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top