************************************************************************************************ * * 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 ENDFUNCThis 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.