判断foxpro的dbf文件的版本

最近用到判断dbf版本的代码,通关百度没有找到,还好有万能的google

记录下来以备以后使用!最后看cReturn的返回值就行了!
&&&判断dbf文件的版本号是什么吗
&&Function FileType(cFileName)
cFileName=”1224.DBF” &&表明文件所在的路径
Local nFileHeader
Local cRead
Local cReturn
nFileHeader = FOpen(cFileName,0)
cRead = fRead(nFileHeader,1)
Do Case
Case Asc(cRead) = 0x02
cReturn = “FoxBASE 文件”
Case Asc(cRead) = 0x03
cReturn = “FoxBASE+/dBASE III PLUS, 无备注”
Case Asc(cRead) = 0x30
cReturn = “Visual FoxPro 数据文件”
Case Asc(cRead) = 0x43
cReturn = “dBASE 4 SQL 表格,无备注”
Case Asc(cRead) = 0x63
cReturn = “dBASE 4 SQL 系统文件,无备注”
Case Asc(cRead) = 0x83
cReturn = “FoxBASE+/dBASE 3 PLUS, 有备注”
Case Asc(cRead) = 0x8B
cReturn = “dBASE 4 有备注”
Case Asc(cRead) = 0xCB
cReturn = “dBASE 4 SQL 表格文件,有备注”
Case Asc(cRead) = 0xF5
cReturn = “FoxPro 2.x (or earlier) 有备注”
Case Asc(cRead) = 0xFB
cReturn = “FoxBASE”
OtherWise
cReturn = “不能识别的格式”
EndCase
=fclose(nFileHeader)
? cReturn

&&Return cReturn
&&&   EndFunc

 » 本站地址:http://www.gomoth.com

标签: