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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

views opening exclusive even with set exclusive off???

Status
Not open for further replies.

EMJULIAN

Programmer
Aug 14, 2002
45
US
I am working with several views on a form as data sources for grids. The views are opening exclusivly, even though I have SET EXCLUSIVE set to OFF. Is there somewhere else to set EXCLUSIVE? Having them open exclusive is causing problems with my application.

Thanks!
Eve
 
How are you opening the views, in code or thru the data -enviroment? If you are openging them in code the you should open each on in the init event of your form and then call them by selecting them. For example

****Form's Init
Use myGrid1 again in 0
Use myGrid2 again in 0
Use myGrid3 again in 0

****Grid's init
select myGrid1
this.recordsource = "myGrid1"


if they are in the data-environment you can just select them.

Hope this helps.

-Kevin

 
Exclusive isn't checked in Tools. I open the views and other table in form A using:

Use Database
Use myView in 0
select myView
set index to.....

then I run form B, which is where the views are actually used.

I have tried putting a SET EXCLUSIVE OFF before the USE DATABASE but that didn't seem to work. Neither did using the views "shared".

The real problem I am having is occasionally when trying to write to a view that is attached to a table I get a "record is in use by another user" error. Except that I am the only user and it's a local table. I select the view and then it hangs up at:
replace eventview.no_entries with eventview.no_entries+1

The problem is it doesn't do it all the time and I can't see a pattern so I can't figure out what's causing the record to lock (the status is exclusive even when the error occurs).

Thanks!

Eve
 

Try :
Use myView shared again in 0


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
When a view is opened a (momentary?)record lock occurs in the DBC. This can cause errors if another user tries to use the view at the same time.

I use a separate DBC for views and include it in the project. Every user has a their own copy of the views, so there is never a conflict.

Regards,

Mike
 
mspratt

When a view is opened a (momentary?)record lock occurs in the DBC. This can cause errors if another user tries to use the view at the same time.

That would be very annoying in an environment of 200 users, wouldn't it?


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hello Mike Gagnon.

>> That would be very annoying in an environment of 200 users, wouldn't it? <<

Yes, it was when we encountered this problem back in 1999. We, too, solved the problem by giving each user his own local copy of the dbc for views. We automated things so that when the user started up the app, the local dbc was built on the fly so we could ensure that everyone had the current copy of the view definitions.




Marcia G. Akins
 
Hi Mike and Marcia,

Annoying for any number of users.

I like Marcia's method of creating the view DBC "on the fly" and if I were writing commercial apps I would do the same. I am porting clipper routines "in house" to VFP using the Codebook framework and it already has a separate DBC for the views, so it's easiest to just include that DBC in the build.

Regards,

Mike
 
MarciaAkins

>> That would be very annoying in an environment of 200 users, wouldn't it? <<

Yes, it was when we encountered this problem back in 1999.

Actually my comment was a sarcastic one, I have a form being used by 25 users which contains 8 views that are recordsources to grids, and the users are permitted to add delete and edit, and we never encountered this situation and never did any "work around" programming for it. This is a single database, single executable.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Hello Mike Gagnon.

>> we never encountered this situation and never did any "work around" programming for it. <<

Well, 25 users and 8 views is not that many. The lock on the dbc is only momemtary when the view is first opened. It does become a problem when you have hundreds of views and hundreds of users ;-)

In the codebook framework, every business object is based on a view, so we are probably talking at least 80 views, not 8.



Marcia G. Akins
 
Marcia

MarciaAkins said:
Well, 25 users and 8 views is not that many. The lock on the dbc is only momemtary when the view is first opened. It does become a problem when you have hundreds of views and hundreds of users

Fair enough, if ever I get handed a project of that scope I'll keep this information in mind. Thank you.



Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top