Wouldn't you want to consistently use the business object for all data access instead of mixing table access in with your user interface anyway? Seems like that would be one solution to this type of situation while having the side effect of compartmentalizing your data access and UI code.
Just another thought (and hopefully a better one than the last!).
Marty
My app runs with Set Exclusive Off
That's not the issue... It has to do with using the table once for one purpose (say a grid on a FoxPro form), and then trying to use it again for another purpose, but under a different alias.
You have use the AGAIN keyword on the USE statement the any time you try to use the table a second time in a data section.
Hey Matt,
I get around this in my desktop apps by setting Exclusive off. WebConnection has this as a requirement so I started adopting that thinking too.
Just a thought,
Marty
Rick - I hit a problem with the Open() method on the wwBusiness class today. I am using the class with FoxPro DBF tables and a desktop app.
The issue I had was that the form I was using had already USED the DBF table under an alias that was different than the DBF filename, and then I created a wwBusiness object, and when its Open() method was called, it tried to USE the table also, but failed, because the table was already being used, but under a different alias.
To me it seems like the Open() method should use the AGAIN keyword to prevent this error from happening.
Like this:
USE ( THIS.cDataPath + lcFile ) AGAIN ALIAS (lcAlias)
Here is the code from your class:
LPARAMETER lcFile, lcAlias, llForceReconnect LOCAL lcConnectString lcFile=IIF(!EMPTY(lcFile),lcFile,THIS.cFileName) *** Nothing passed and no MasterTable - exit IF THIS.nDataMode = 0 AND EMPTY(lcFile) RETURN .F. ENDIF DO CASE CASE THIS.ndatamode = 0 lcAlias=IIF(!EMPTY(lcAlias),lcAlias,THIS.cAlias) IF !EMPTY(lcFile) AND UPPER(lcFile) == UPPER(THIS.cFileName) THIS.cAlias = lcAlias ENDIF IF USED(lcAlias) SELE (lcAlias) ELSE SELE 0 USE ( THIS.cDataPath + lcFile ) ALIAS (lcAlias) IF !USED(lcAlias) THIS.seterror("Unable to open " + THIS.cFileName) RETURN .F. ENDIF ENDIF