Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error 1709
Message
From
05/02/1999 10:43:35
Eric Barnett
Barnett Solutions Group, Inc
Sonoma, California, United States
 
 
To
04/02/1999 22:34:44
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00183899
Message ID:
00184369
Views:
31
I'm assuming the following situation:

You have a bunch of views in a DBC. The DBC is shared by all of the users on the network, including the views.

The problem is that opening the view places a lock on a record in the database container. If two users try to open the same view at the same time, one of them will always be denied.

There are two solutions to this problem. One is something like the following:

cOldError=ON("ERROR")
ON ERROR DO SkipError
FOR nCounter=1 TO 20
USE (View)
IF USED(View)
EXIT
ELSE
WAIT WINDOW "Accessing database..." TIMEOUT 1
ENDIF
ENDFOR
ON ERROR &cOldError
IF !USED(View)
*Generate error
ENDIF

FUNC SkipError
RETURN

However, I'm not exactly sure how to get this in to the DE properly, and I wouldn't recommend it for an App with a ton of users.

The second solution, that works perfectly (but you won't like it), is to move the views to a separate DBC and distribute the new DBC with the app to each workstation (this is what I do). When you create a view, have the target database open as well. Then, when asked which tables to add to the view, switch databases in the combo box that appears with a list of databases.

You end up with views based on SQL like this:

SELECT (FIELDS) FROM database!table

Then all you have to do is guarantee that the database that contains the tables is open. This eliminates the problem you are describing.

Hope this helps...

>Views-a-plenty.
>
>
>>Are you using views in your DE?
>>
>>>>Ok, this is a last ditch effort before I call Microsoft. One of my applications has begun throwing 1709 (Database object is in use by someone else) often enough to make my users want to kill me.
>>>>
>>>>I have yet to get a clear picture of what causes this error. A search on the MSKB turned up an article that recommends a simple RETRY in the error handler when this pops up. So I put this in the very first line of my ON ERROR routine. Now, instead of popping up an error message, I get "Mismatched Pushjmp/ Popjmp" from VFP (this is not a trappable error), and clicking ok causes the program to quit.
>>>>
>>>>I just spoke to a user that said this happened to her 5 times already this morning. This is the only app I've written that has this problem... what is going on?
>>>
>>>Forgot to mention- the 1709 is always thrown from the DataEnvironment.OpenTables method.
Eric Shaneson
Cutting Edge Consulting
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform