Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datasets in different folders
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00488886
Message ID:
00489032
Vues:
15
Larry, thanks for your reply. I think I understand waht you are suggesting.. to Put code into the BeforOpenTablesMethod of the dataenvioronment to change the cursor location. My problem with this is that the Dataenvironment cannot be subclassed.. does this mean I must amend every single form that I use. Is there anywhere in my Base Class (either the form or somewhere else)that I could do this, so that I need to do it only once and it can be subclassed?

One other thing I cannot understand with the dataenvironment. In my development pc, say I set up a Form and in the dataenvironment the Database Cursor is set to C:\MYDir\MyDBc. I then copy the whole system out to the client into f:\Apps and , without any modifications on my part, the dataenvironment cursor reads f:\Apps\Mydbc. If its hard coded, how come it changes automatically ?

Regards,

Gerard






>>Hi.
>>I have a situation where I have a set of common DBC in a standard folder, which will always be the same, and then need to store other DBCs in specified folders , depending on a processing year:
>>Example:
>>
>>At Client Site My Development PC
>>-------------- -----------------
>>
>>MYCOMMON In \Common \COMMON
>>
>>Then depending on the app
>> MYDbc1 In \Common\Year1 \Common\DEVELOP
>> MyDbc2 In \Common\Year1 \COMMON\DEVELOP
>>
>> MYDbc1 In \Common\Year2 \COMMON\DEVELOP
>> MyDbc2 In \Common\Year2 \COMMON\DEVELOP
>>
>>The strucure of the DBC and Dbf will be identical but different users could have Year1 and Year2 apps open at the same time.
>>
>>On my development pc, I would like to maintain and test/develop in just the Common folder and have the app/year specific files in \Common\DEVELOP
>>
>>I would appreciate any guidance on the best way of handling this. For instance, I think that the Data Environment will hold the \COMMON\DEVELOP hardcoded in and I suspect this will be a problem. I'm also wondering if there are any other issues I should be aware of.
>>
>>Thanks in advance,
>>
>>Gerard
>
>Gerard,
>A little bit different take than Hiten would be to add everything in the dataenvironment of your form using your development environment. The relative path will be stored in the cursor records of the form but that's okay. Create a mapping table to hold year and directory information. Add code to the BeforeOpenTables event of the Dataenvironment to manipulate the database directory.
>
>Ex.
>local lxx, lotemp
>local array ladeobjects[1]
>for lxx = 1 to amembers(ladeobjects,THIS,2)
>	lotemp = eval("THIS."+ladeobjects[lxx,1])
>	if vartype(lotemp) = "O" ;
>		and upper(lotemp.Baseclass) = "CURSOR" then
>		wait lotemp.Database window
>		wait justfname(lotemp.Database) window
>		lotemp.Database = "new directory here\" + justfname(lotemp.Database)
>	endif
>endfor
>You could store the directory in an application object property whenever the user selects the year they want. For development mode, you could add code to check the return value of version(2). If itis greater than 0, you know you are devlopment mode and you can set the path accordingly.
>
>You don't have to call OpenTables because the cursor objects will be in place in the DE and during the default DE instantiation, if AutoOpenTables is .T. the tables will be opened normally.
>
>HTH.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform