Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Form DE vs. Load event
Message
From
06/02/2006 19:31:08
 
 
To
05/02/2006 22:06:13
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01092186
Message ID:
01094162
Views:
20
I use the following UDF for setting the cursors path:
************************************************************************************************
*
*  Routine for setting the database directory location for the form
*
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
ENDFUNC
This is called in the Dataenvironment.BeforeOpenTables() method:
=SetDBCPath(thisform.Dataenvironment,gcDBCPath,"DBCName")
The second parameter is the path to set to; the third parameter is the name of the database.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform