从FoxPro数据库中提取结构/索引到Excel

 

有一个数据上传程序和几个工具,用于从Visual中当前选择的别名创建MySQL创建表脚本。

或者,如果您想手动执行Excel路径,那么.

如果您有一个具有以下结构的表MYTABLE.DBF:

Structure for table:          C:\TEMP\MYTABLE.DBF
Number of data records:       0       
Date of last update:          01/05/2014
Code Page:                    1252    
 Field  Field Name            Type                        Width      Dec    Index   Collate     Nulls       Next       Step
     1  FIRSTNAME             Character                      20                                    No
     2  LASTNAME              Character                      20                                    No
     3  AGE                   Numeric                         3                                    No
     4  ID                    Integer (AutoInc)               4               Asc   Machine        No          1          1
** Total **                                                  48

然后,您可以通过VFP命令窗口将结构转储到另一个DBF,如下所示:

cd \temp
use mytable
copy structure extended to mytablestruct.dbf

然后,可以打开包含结构信息的表,并将其转储为XLS格式:

use mytablestruct
copy to struct.xls type xl5

在Excel中,如下所示:

对于索引,您必须编写这样的一个小例程:

    Create Cursor indexinfo (idxname C(254), idxtype c(254), idxkey c(254), ;
        idxfilter c(254), idxorder c(254), idxcoll c(254))
    Use mytable In 0
    Select mytable
    lnTags = ATagInfo(laTemp)
    For i = 1 to lnTags
        Insert into indexinfo values (laTemp[i, 1], laTemp[i, 2], laTemp[i, 3], laTemp[i, 4], laTemp[i, 5], laTemp[i, 6])
    EndFor
    Select indexinfo
    Copy To indexinfo.xls type xl5

打开结果的indexinfo.xls:

posted on   lzlvv  阅读(85)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 单元测试从入门到精通
· 上周热点回顾(3.3-3.9)
· winform 绘制太阳,地球,月球 运作规律
历史上的今天:
2020-09-15 查看windows操作系统的默认编码

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示