Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where is the DBC?
Message
De
02/04/1998 15:26:31
 
 
À
02/04/1998 14:35:21
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00088796
Message ID:
00089036
Vues:
42
>>>>>>>>I'm deloping apps on a network. The production version of these apps are looking for data on the development drive. How do I change the path that the Form's Data Environment looks for the data?
>>>>>>>
>>>>>>>Add code in Dataenvironment.BeforeOpenTables event
>>>>>>>local cDbcpathname
>>>>>>>select config && this is configuration table
>>>>>>>go top
>>>>>>>cDbcpathname=alltrim(config.dbcpname)
>>>>>>>thisformset.setall("database",cDbcpathname,"cursor")
>>>>>>>You can use this code if all DE.cursors are for dbc-tables. If you have free tables then you should modify this code to reset CursorSource properties.
>>
>>
>>
>>This procedure works fine. How can you save this as an abstract custom method on a form?
>
>You can have generic oApp method 'setdatabase'
>***oApp.setdatabase
>LParameter oForm
>local cDbcpathname
>select config && this is configuration table
>go top
>cDbcpathname=alltrim(config.dbcpname)
>oForm.setall("database",cDbcpathname,"cursor")
>return
>
>Each form DE will call:
>oApp.setdatabase(thisform)


This makes sense to me. I thought it would save me a lot of time if I saved this code in the DE of a form and save the form as a class. (because each form will be using the same database. This didn't work. Do you know why? Thanks for your help.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform