home *** CD-ROM | disk | FTP | other *** search
- *⌐░⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐┤
- *⌐ª Program: UNLOCKDB.PRG ⌐ª
- *⌐ª Function: ╩╣╙├ LLIO ║»╩²░╤╩²╛▌┐Γ╘¡┐¬═╖╡─╡┌╥╗╕÷╫╓╜┌╨┤╗╪, ⌐ª
- *⌐ª ╥╘╜Γ│²▒ú╗ñ╡─╖╢└². ⌐ª
- *⌐ª Usage: =UNLOCKDB("Database name") ⌐ª
- *⌐╕⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐ñ⌐╝
- FUNCTION unlockdb
- PARAMETERS file_name
- PRIVATE file_name, file_alias, handle, keybyte
-
- IF AT(".",file_name) = 0
- file_alias = file_name
- file_name = file_name + ".DBF"
- ELSE
- file_alias = SUBSTR(file_name,1,AT(".",file_name)-1)
- ENDIF
-
- handle = FOPEN(file_name,2)
-
- IF handle = -1
- WAIT "UNLOCKDB() ╬▐╖¿╨┤╗╪╥╤┤≥┐¬╩²╛▌┐Γ " + file_alias +;
- " ┐¬═╖╡─╡┌╥╗╕÷╫╓╜┌."
- RETURN(.F.)
- ENDIF
-
- * ╢┴╚í▒φ═╖╡─╡┌╥╗╕÷╫╓╜┌
- keybyte = FREAD(handle,1)
- * ╜½╬─╝■╓╕╒δ╥╞╗╪╡┌╥╗╕÷╫╓╜┌
- = FSEEK(handle,0)
- * ╙├▒╚╘¡└┤╡═┴╜╬╗╡─ ASC II ╫╓╖√╨┤╗╪
- = FWRITE(handle,chr(asc(keybyte)-2))
- * ╣╪▒╒╬─╝■
- = FCLOSE(handle)
-
- RETURN(.T.)