Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to close \DATA\AppData ?
Message
From
03/11/2004 03:40:50
 
 
To
03/11/2004 02:18:36
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00957045
Message ID:
00957484
Views:
15
Hi Gojko:

I'm not sure I totally understand what you are trying to do.

>and again reopen \DATA\Appdata.dbc without messing with Appreg01 ?!

Again, I don't know exactly what you mean by "without messing with Appreg01". However, if you look back through the Codemine section of this forum over the last few weeks, you will see an explanation I gave to Mike about how Codemine handles tables or views that are created in a database other than AppData.dbc. Codemine will open a view based on the dbc that "owns" the tables/view that are being used by the application. In each differently named database, it creates a DBC specific Appreg01 table. It will keep these views open for each one it encounters. Therefore, multiple copies of the dbc specific Appreg01 will persist.

Therefore, you could try to take advantage of this behaviour. So, say your company specific folders under data are named D01, D02, D03 ..., then instead of using AppData for each company, create a company specific database for each company and totally ignore Appdata.dbf - you don't have to use this.

So, in your system's meta-data creation routines, in folder D01, create a dbc called AppDataD01, in folder D02, create AppDataD02 and so on. For each folder, ensure that your tables are owned by the "folder specific" version of AppData.

As far as I can see, in this way, you would not have to worry about opening and closing the various databases. Codemine will create a view pointing to each database and every one encountered will remain open. Each open database will contain a dbc specific version of Appreg01 ie, AppDataD01_Appreg01, AppDataD02_Appreg01 and so forth.

HTH


>Fizzy !? Sorry if I sounded like that (but that was my last intention; for me that was desperately !)
>
>To clarify myself how to close and reopen Appdata.dbc I try to execute the code bellow from MAIN MENU
>
>*----------------------------------------
>public _fromWhere
>local _curr_dir, _disk_k, dd, d1, d2
>*
>_curr_dir = curdir()
>_disk_k = sys(5)
>_fromWhere = _disk_k + _curr_dir
>*----------------------------------------
>dd = _fromWhere + "DATA\D01"
>d1 = _fromWhere + "DATA"
>d2 = _fromWhere + "DATA\AppData"
>*----------------------------------------
>SET PATH to &dd
>OPEN DATABASE Appdata
>SET DATABASE to Appdata
>*
>CLOSE DATABASE && WORK !
>*
>IF !DBUSED('&dd\Appdata')
> WAIT "BASE &dd\Appdata NOT ANY MORE in USE !" WINDOW at 14,40 TIMEOUT 5
>ELSE
> WAIT "BASE &dd\Appdata STILL in Use !" WINDOW at 14,40 TIMEOUT 5
>ENDIF
>*
>SET PATH to &d1
>SET DATABASE to &d2
>*==================================
>* ? …
>* ? …
>* m.goApp.oRegistry.CloseAll()
>* ? …
>* ? …
>*==================================
>CLOSE DATABASE && DOES NOT WORK !!!
>*
>IF !DBUSED('&d2')
> WAIT "ORIGINAL BASE NOT ANY MORE in USE !" WINDOW at 14,40 TIMEOUT 5
>ELSE
> WAIT "ORIGINAL BASE STILL in USE !" WINDOW at 14,40 TIMEOUT 5
>ENDIF
>*
>
>The problem is how to close \DATA\Appdata.dbc, open the same dbc in one of it's subdirectories , close it, and again reopen \DATA\Appdata.dbc without messing with Appreg01 ?!
>
>Thank you for your patience !
-=Gary
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform