Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Question about the Open() method in wwBusiness

$
0
0
Re: Question about the Open() method in wwBusiness
West Wind Client Tools
Re: Question about the Open() method in wwBusiness
12/03/2011
01:17:56 PM
3DI0SI98T Show this entire thread in new window
From:
To:
Attachments:
None
Thanks Matt,

Yes it should actually re-open files if it's possible in shared mode.
Fixed.

+++ Rick ---


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





Rick Strahl
West Wind Technologies

Where do you want to surf today?
Reader Version: 5.0

from Maui, Hawaii



Viewing all articles
Browse latest Browse all 10393

Trending Articles