Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Defaults and Paths on App Startup
Message
 
À
08/12/2005 10:10:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01076049
Message ID:
01076174
Vues:
18
Thank you Greg,
I didn't need to changed anything right now. I keep your suggestion in mind for further use.

>I set my paths for database tables and free tables in the Dataenvironment event BeforeOpenTables() of forms. In this event, I have the following:
>
>
>=SetDBCPath(thisform.Dataenvironment,gcDBCNetwkPath,"Catalog")
>
>
>The parameter "gcDBCNetwkPath" is a global that defines the database path; the last parameter is the database name to change the path for. The UDF is as follows:
>
>
>FUNCTION SetDBCPath
>PARAMETER 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
>ENDFUNC
>
>
>If you need to update for a free table, the following UDF is used:
>
>
>FUNCTION SetDBFPath
>LPARAMETERS poForm,pcDBFPath
>LOCAL lnNumCursors, lnNdx, lcDBFName
>LOCAL ARRAY lcProperties[1]
>lnNumCursors = AMEMBERS(lcProperties,poForm,2)
>FOR lnNdx=1 TO lnNumCursors
>	IF UPPER(LEFT(lcProperties[lnNdx],6)) = "CURSOR"
>		IF EMPTY(poForm.&lcProperties[lnNdx]..database)
>			lcDBFName = JUSTFNAME(poForm.&lcProperties[lnNdx]..CursorSource)
>			poForm.&lcProperties[lnNdx]..CursorSource = pcDBFPath + lcDBFName
>		ENDIF
>	ENDIF
>ENDFOR
>RETURN
>ENDFUNC
>
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform