Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating a Included DBF File During Run Time
Message
De
08/06/2013 12:12:58
 
 
À
08/06/2013 12:05:11
Mike Yearwood
Toronto, Ontario, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01575904
Message ID:
01575910
Vues:
52
J'aime (1)
>>>I have a File Unitdetails.dbf which has one Record, the name of the unit. I have included that file in my .exe application. However i want that the user shoud be able to change the name of the unit. .i.e the name of the unit shall be update able, althogh no new records to be added.
>>>
>>>Is it possible ti keep file included and at the same time the file be update able.
>>>
>>>Regards
>>
>>
>>Yes, but it requires low-level file access from a spawned remote process that does the update once the application has terminated. It's a simple matter of opening the .EXE, locating the table within, and doing the update. You'll need to add markers that you can explicitly search for within the .EXE, use FILETOSTR() to load the .EXE file, make the change with STUFF(), and then STRTOFILE() to write the .EXE back out.
>>
>>Simple. :-)
>
>Very sneaky.


If it works, it works, right? :-)

The markers are something simple like:
CREATE TABLE myTableToUpdate.dbf ;
( ;
    marker1 c(10), ;
    cUpdate c(200), ;
    marker2 c(10) ;
)

INSERT INTO myTableToUpdate.dbf ;
    VALUES("1234567890", "Whatever name goes here", "0987654321")
Then to locate the markers, locate the first one, and locate the second one, and determine the width between. If it is the width of the cUpdate field, then it is identified properly. If that marker is found other places, then switch it, or add a 3rd or 4th, etc.

:-)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform