您的位置:程序门 -> vb -> 基础类



求教 把sql表转换成dbf格式


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


求教 把sql表转换成dbf格式
发表于:2007-04-28 10:04:54 楼主
不仅是连接到dbf,而是把表转换成dbf格式。
      dbf文件是有代码自动生成的,有数据结构的。
发表于:2007-04-28 11:04:221楼 得分:0
rstrecordsetdbf.open   "select   *   from   pz01 ",   conconnection,   adopenkeyset,   adlockoptimistic

        while   not   rstrecordset.eof

                rstrecordsetdbf.addnew

                for   lngindex   =   0   to   rstrecordset.fields.count   -   1
                        if   lngindex   =   0   then
                                rstrecordsetdbf.fields(lngindex)   =   format(rstrecordset.fields(lngindex),   "yyyy/mm/dd ")
                                rstrecordsetdbf.fields(lngindex)   =   left(rstrecordsetdbf.fields(lngindex),   4)   &   "/ "   &   mid(rstrecordsetdbf.fields(lngindex),   6,   2)   &   "/ "   &   right(rstrecordsetdbf.fields(lngindex),   2)
                        else
                                rstrecordsetdbf.fields(lngindex)   =   iif(isnull(rstrecordset.fields(lngindex)),   " ",   trim(rstrecordset.fields(lngindex)))
                        end   if
                next
               

                rstrecordsetdbf.update
                rstrecordset.movenext
        wend


第一行是连接到dbf数据库
后面是将在sql数据库中,读取的数据,依次写入到dbf数据库中


快速检索

最新资讯
热门点击