Robin,
You can Try something like this:
lnDBFType=dbftype(yourtable)
do case
case lnDBFType=-2 && Invalid file name
case lnDBFType=-1 && Cannot open file
case lnDBFType=48 && VFP Table's first byte is 0x00000030
otherwise && There are different values for 2.6 tables
endif
function dbftype
parameters lcFileName
private lnFH, lcChar
* Should work with visual and 2.6
if type('lcFileName')#'C' or not file(lcFileName)
return -2
endif
lnFH=fopen(lcFileName)
if lnFH=-1
return -1
endif
lcChar=fgets(lnFH, 1)
=fclose(lnFH)
return asc(lcChar)
HTH
Hugo
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges