clearing of archives

clearing of archives

Postby Silvio.Falconi » Thu Jan 20, 2022 8:51 am

In a conversion procedure I have to clear all the archives and then populate them during the conversion.
The archives were all opened with Tdatabase and therefore in share
Archives are indexed with the! Deleted () clause
I don't know how to do the zeroing of archives and the dbpack since it cannot be done in Tdatabase
I don't know if it is better to delete all the archives and create them again or there is another solution
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6770
Joined: Thu Oct 18, 2012 7:17 pm

Re: clearing of archives

Postby Marc Venken » Thu Jan 20, 2022 8:58 am

Are the new archives also changed in structures ?
ntx to cdx ? or also the same ?
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: clearing of archives

Postby Silvio.Falconi » Thu Jan 20, 2022 9:56 am

The application that I am putting in place serves to make the substitutions of teachers every morning, I am changing it because we have decided to transform it into a network with user management.

Initially to use the procedure it was necessary to insert the data in all the archives (teachers, classes, classrooms, lessons etc.), to avoid entering everything from scratch because it is unnerving, I created a conversion procedure from an Excel archive that is generally used in all schools that automatically and in a short time extracts the data and puts them in the archives.

Then I proceed to convert from Excel to an import.dbf (oImport) archive

Then from this oImport archive I have to populate a series of archives (classes, classrooms, teachers, timetables, lessons, subjects, groups) through a procedure created by me, but the archives must be empty., And then the indexes must be recreated.

Probably this operation must be done by only one and not the shares, so before loading the conversion procedure I have to check if the users have logged out of the system. and only then can I call up the procedure and open the archives exclusively.

how should i check if a user is inside the system?
I have to check the user archive and the TAbations archive to see if there is a user who has entered the system
If there is someone I send a message "You must exit the system" through a procedure of messages between users of the same program and then I have to proceed and then I can use the archives in exclusive mode and use pack and zap.

Are there any other solutions?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6770
Joined: Thu Oct 18, 2012 7:17 pm

Re: clearing of archives

Postby Marc Venken » Thu Jan 20, 2022 10:15 am

I would concider

Make a conversion folder (for putting temporary dbf)
from the program folder copy the needed dbf's with the copy structure command to conversion folder (dbf's will be empty but have all fields)
fill the dbf in the conversion folder and generate the index file's
see if you have all users logged out and copy the files back to program folder. This process will be quick
This process could also be done timed ex. at 04.00 am so there is no one on the system.

The same can also be done in the program directory but there you can use the ZAP command or function.
Marc Venken
Using: FWH 23.04 with Harbour
User avatar
Marc Venken
 
Posts: 1343
Joined: Tue Jun 14, 2016 7:51 am
Location: Belgium

Re: clearing of archives

Postby Jimmy » Fri Jan 21, 2022 6:57 am

hi,

i do create DBF / Index if not exist ...

you can open a DBF EXCLUSIVE when NO User is Connect ... than you can Ferase() it
to find out "who" is Connect to DBF is another Question
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1585
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: clearing of archives

Postby nageswaragunupudi » Sun Jan 30, 2022 5:39 pm

I don't know how to do the zeroing of archives and the dbpack since it cannot be done in Tdatabase


if the table is open exclusively,

oDbf:Zap()
oDbf:Pack()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10248
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 88 guests