[dba-VB] Saving Data within a VB exe

Stuart McLachlan stuart at lexacorp.com.pg
Sat Apr 5 21:58:03 CST 2003


On 5 Apr 2003 at 16:01, t tom wrote:

> Hi All
> 
> Can data be saved and/or updated from within a VB exe file.
> For example , Can I "make room " for a person's name, address , etc in
> a VB EXE file. Then can I update this data. I don't want to use a text
> or database file.
> 
> 
There are two options that we used to use with DOS applications:

1. As Jim has already suggested - store a unique string and later rfind it 
and write to that location. 

2. Get the length of the executable and then append your data to the end  
of the file.  As long as you append a fixed length, you than then read this x 
number of bytes from then end of the executable later.

Both of these have methods have problems in Windows with the 
executable being locked by the OS while it is running.  You may be able to 
do it opening the file as "LOCK SHARED"

Also many antivirus programs don't like to se executables changing!

There's a bit of discussion about this in the PowerBasic forums at :

http://www.powerbasic.com/support/forums/Archives/Archive-
000003/HTML/20000801-4-000389.html

http://www.powerbasic.com/support/forums/Archives/Archive-
000003/HTML/20000801-4-000299.html

(watch for line wraps)



-- 
Lexacorp Ltd
http://www.lexacorp.com.pg
Information Technology Consultancy, Software Development,System 
Support.





More information about the dba-VB mailing list