Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing path from Data Environment
Message
From
11/05/2005 16:22:37
 
 
To
11/05/2005 13:35:12
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01013036
Message ID:
01013150
Views:
10
I have a UDF that sets the path to the tables prior to opening the tables defined in the dataenvironment:

The call should be placed in the BeforeTablesOpen event of the dataenvironment:

=SetDBCPath(thisform.Dataenvironment,gcDBCPath,"NameOfDBC")

gcDBCPath is the desired path to the production tables (can be different for different PCs); the third parameter is the name of the database (not table).

The program:
*FUNCTION SetDBCPath
LPARAMETERS poForm,pcDBCPath,pcDBCName
LOCAL lcDBCName, lcFilePath, lnNumCursors, lnNdx
lcDBCName  = FORCEEXT(pcDBCName,"DBC")
lcFilePath = ADDBS(pcDBCPath) + lcDBCName
lnNumCursors = AMEMBERS(lcProperties,poForm,2)
FOR lnNdx=1 TO lnNumCursors
   IF UPPER(LEFT(lcProperties[lnNdx],6)) = "CURSOR"
      IF ATC(lcDBCName,poForm.&lcProperties[lnNdx]..database) > 0
         poForm.&lcProperties[lnNdx]..database = lcFilePath
      ENDIF
   ENDIF
ENDFOR
RETURN
This will set the desired table path at run-time.
Previous
Reply
Map
View

Click here to load this message in the networking platform