Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to access the data in case of network ?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00031739
Message ID:
00032338
Views:
42
>>>>There are 2 options :
>>>>1. You set your DE to access tables in the Network Harddisk
>>>>or
>>>>2. You open the tables manually in the Init Event or Load Event of the
>>>>form.
>>>>
>>>>I prefer the second option.
>>>>
>>>>HTH - Tony
>>>
>>>
>>>If all your tables are in a DBC on the server, you can open the database when your application starts. Then, all your tables will be available for use. The only line of code that has to include the path where the DB is the one that opens the DB. This works wll for me.
>>>
>>>HTH - Mark
>>
>>All tables are in Dbc. (in fact 3 DBC). When The app starts i open each DBC on the server. When I try "USE MY TABLE" it works fine. When the form load, vfp try to open the data in the local drive.
>>Maybe Have I to "SET DATABASE TO .... " in the beforeopentable of the DE of my forms ?
>>I will try.
>>Thanks for your help
>>Michel
>
>
>Michel:
>
>I think your problem is in the DE of the form. When you created the form and added tables to your DE, the tables were on your hard-drive. This is where the form is still looking for the tables even though you have opened the DBs. If you are adventurous, you can open the form table just like a dbf (use FormName.scx - you have to include the ".scx"). BEFORE YOU DO THIS, I STRONGLY ADVISE YOU BACKUP ALL .SCX AND .SCT FILES! You can then:
>
> SET FILTER TO UPPER(BASECLASS)="CURSOR"
>
>BROWSE the table. In the PROPERTIES memo field, you should see a line:
>
> database = c:\MyAppDir\MyApp.dbc
>
>You can manually change the location of the drive/path to where the DBC is now (this is safer). Or you can experiment with STRTRAN() to do a mass replace of all the records of the PROPERTIES field (MAKE ABSOLUTELY SURE THE FILTER IS SET PROPERLY!):
>
> replace all properties with ;
> StrTran(properties,"c:\MyAppDir\MyApp.dbc","x:\NewAppDir\MyApp.dbc")
>
>However, this is CASE-SENSITIVE. You can opt for:
>
> replace all properties with ;
> StrTran(UPPER(properties), ;
> "C:\MYAPPDIR\MYAPP.DBC", ;
> "x:\NewAppDir\MyApp.dbc")
>
>The down-side to this, if it matters, is that all the text in the memo fields will be changed to upper-case. The "x:" in the 3rd parameter would be the drive letter where your DBC is now located.
>
>This will convert all occurrences of "c:\MyAppDir" to what you pass as the 3rd parameter of the StrTran() function. Close the table and go to the next form.
>
>Good Luck,
>
>Mark

I had a rather similar question in my thread "paths in the data environment". M. Fournier advised me to set the .AutoOpenTables property of the DE to .F., then set the .Database property of the cursors to whatever path I want in the form load(), then use the .OpenTables method of the DE. I think that answer would also apply to you.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform