General information
Title:
Help! Weird message while packing tables
Hi,
I have a .prg file to pack all the free tables in a folder. It works fine for some tables, but for some dbf files it gives an error message that some code page is not available etc. I have no clue how packing has anything to do with code pages.
The script is compiled into a .exe file and is winExec'ed from a VC++ 5.x program.
Any clues?
I appreciate ur help.
Thanks
Puri
*====My code for packing all free tables in folder========
parameters sPath
if parameters() < 1
MessageBox("Please provide the directory for packing")
quit
endif
if len(sPath) <= 0
MessageBox("Please provide the directory for packing")
quit
endif
on error do errhandler with Message()
set path to &sPath
* Get list of tables in the folder sPath
local nTables, sName
nTables = adir(aTableInfo, sPath+"\*.dbf", "A")
for i = 1 to nTables
* Needs exclusive access to the table
if upper(right(atableinfo(i, 1), 3)) != "DBF"
loop
endif
sName = left(atableinfo(i, 1), len(atableinfo(i, 1))-4)
use &sName
select &sName
pack
use
endfor
return 0
function errhandler(sErrMsg)
MessageBox("Error: "+sErrMsg)
quit
endfunc
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only