Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Opening a table from a DBC with different pathing
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01259546
Message ID:
01259627
Vues:
11
>I allow the database to be set based on user preferences and also to allow for different drive mapping letters if in a network. In the form.dataenvironment.BeforeTablesOpen(), I call the following:
>
>
>FUNCTION SetDBCPath
>LPARAMETERS poFormDE,pcDBCPath,pcDBCName
>LOCAL lcDBCName, lcFilePath, lnNumCursors, lnNdx
>lcDBCName  = FORCEEXT(pcDBCName,"DBC")
>lcFilePath = ADDBS(pcDBCPath) + lcDBCName
>lnNumCursors = AMEMBERS(lcProperties,poFormDE,2)
>FOR lnNdx=1 TO lnNumCursors
>	IF UPPER(LEFT(lcProperties[lnNdx],6)) = "CURSOR"
>		IF ATC(lcDBCName,poFormDE.&lcProperties[lnNdx]..database) > 0
>			poFormDE.&lcProperties[lnNdx]..database = lcFilePath
>		ENDIF
>	ENDIF
>ENDFOR
>ENDFUNC
>
>
>This sets the new path for the database. The tables can then be opened as the path is determined from the database. I store the network config into the registry for each user and then pass this in the call to the above UDF.

Won't work, but thanks for trying. In this case, it appears your relative pathing between the DBC and the tables does not change. One client might store the data on the F: drive, one on the H: drive, one on the S: drive, and maybe they use different paths. But the relative pathing between the DBC and the tables does not change. In my case, the relative path changes drastically from the production server in the home office to the servers at the branches to my dev machine. The pathing is very different and that is causing the problem.
eCost.com continues to rip people off
Check their rating at ResellerRatings.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform