vfp新建远程视图文件夹后为什么在vfp上建的表不在里边

天极传媒:天极网全国分站
您现在的位置: &&
从VFP中导出数据的几种方法
  当处理好数据后,这时你可以用多种方法将这些数据导出,以便被其它程序(如等)所用。下面向你简单介绍几种导出数据的方法:
  1.用“导出数据”对话框。你可以从VFP主菜单中选择“文件/导出…”打开“导出”对话框,在该对话框中的“来源”框中输入表名(c:vfpstudents.dbf),在“类型”中指定要导出数据的类型(Microsoft
Excel),在“到”框中输入导出的路径和文件名(C:excelaa.xls),然后按“确定”即可。这时你如果查看command窗口,可发现以下代码:
  COPY TO C:excelaa.XLS TYPE XL5
  2.用COPY TO命令。COPY TO命令的工作对象是VFP中的表,它要依据“TYPE”项才知道要产生哪一类导出文件。对于上面的导出过程,可用以下方法实现:
  USE students
  COPY TO C:excelaa.XLS TYPE XL5
&&& 3.用SET ALTERNATE TO写入ASCⅡ文件。用该命令可以把屏幕上的内容导出,导向一个文件,下面例子可以将系统状态输入到status.txt文件中:
  SET ALTERNATE TO status.txt
  SET ALTERNATE ON
  SET CONSOLE OFF
  ?“系统状态”+DTOC(DATE())+“@”+TIME()
  LIST STATUS
  SET ALTERNATE OFF
  SET CONSOLE ON
  4.用SET PRINTER TO命令。用该命令可把打印输出到文本文件中:
  SET PRINTER TO hello.txt
  SET PRINT ON
  ???CHR(27)+“广大计算机爱好者”
  ??“你们好!”
  ?“祝你们新年快乐”
  SET PRINT OFF
  5.用REPORT FORM TO FILE命令。运行报表的REPORT命令有许多选项,把报表输出保存到文件中的方法为:
  REPORT FORM(报表名)TO FILE(文件名)(江苏 曾庆祝)
责任编辑:)
欢迎在新浪微博上关注我们
笔记本手机数码家电查看: 7591|回复: 3
c#直接操作dbf数据库(可以创建,添加,修改,查询记录,不断完善中)
主题帖子精华
初级会员, 积分 85, 距离下一级还需 115 积分
在线时间0 小时
*created by:yang yongzhen
* 15:27:21
using System.Collections.G
using System.T
using System.IO;
using System.Runtime.InteropS
namespace Classdbf
&&& public class Class_dbf
&&&&&&& /*& DBF 文件头结构& */
&&&&&&& public struct DBFstr
&&&&&&&&&&& public& byte&& DBF3;&&&&&&&&&&&&&&&& /*& DBASE 数据文件标记& */
&&&&&&&&&&& public byte&&& date_n, date_y, date_r; /*& 年月日变量& */
&&&&&&&&&&& public int&&&& reC&&&&&&&&&&&&&& /*& 记录数变量&&& */
&&&&&&&&&&& public int&&&& fild_&&&&&&&&&&&& /*字段数目*/
&&&&&&&&&&& public short&& ldb,&&&&&&&&&&&& /*& 头结构.记录长度变量& */
&&&&&&&&&&& public byte[]&&&&&&&&&&&&&&&&& /*& 头结构保留字节变量& */
&&&&&&& /*& 外部字段信息结构&& */
&&&&&&& public struct DBF
&&&&&&&&&&& public byte[]&&&&&&&&&&&& /*& 字段名变量& */
&&&&&&&&&&& public byte&&&&&&&&&&&&&& /*& 字段类型变量& */
&&&&&&&&&&& public byte&&&&&&&&&&&&& /*字段数据的相对地址*/
&&&&&&&&&&& public byte& width,deC;&&&&&&& /*& 字段长度及小数位变量& */
&&&&&&& public DBF
&&&&&&& public DBF[] dbf=new DBF[8];//最多支持八个字段
&&&&&&& FileS
&&&&&&& /*public void calssdbf()
&&&&&&&&&&
&&&&&&& }*/
&&&&&&& public int opendbf(string path)
&&&&&&&&&&& FileStream file1 = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
&&&&&&&&&&& file = file1;
&&&&&&&&&& // file.Seek(0, SeekOrigin.Begin);
&&&&&&&&&&& file.Seek(0, SeekOrigin.Begin);
&&&&&&&&&&& dbstr.DBF3 =&& (byte)file.ReadByte();
&&&&&&&&&&& dbstr.date_n = (byte)file.ReadByte();
&&&&&&&&&&& dbstr.date_y = (byte)file.ReadByte();
&&&&&&&&&&& dbstr.date_r = (byte)file.ReadByte();
&&&&&&&&&&& byte[] buf=new byte[4];
&&&&&&&&&&& for (int i = 0; i & 4; i++)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& buf =(byte)file.ReadByte();
&&&&&&&&&&& }
&&&&&&&&&&&
&&&&&&&&&&& temp=buf[0]+buf[1]*256+buf[2]*65536+buf[3]*;
&&&&&&&&&&& dbstr.reCord =//记录数目
&&&&&&&&&&& for (int i = 0; i & 4; i++)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& buf =(byte)file.ReadByte();
&&&&&&&&&&& }
&&&&&&&&&&& temp = buf[0] + buf[1] * 256;
&&&&&&&&&&& dbstr.ldb = (short)//VFP表文件头长度=32+32*字段数目+1+263
&&&&&&&&&&& dbstr.fild_num = (dbstr.ldb - 263 - 1 - 32) / 32;//字段数目
&&&&&&&&&&& temp = buf[2] + buf[3] * 256;
&&&&&&&&&&& dbstr.lrd = (short)
&&&&&&&&&&& byte[] buf_1 = new byte[18];//存储字段信息
&&&&&&&&&&& for (int i = 0; i & dbstr.fild_ i++)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& file.Seek(32+32*i, SeekOrigin.Begin);//文件指针指向记录处
&&&&&&&&&&&&&&& for (int j = 0; j & 18; j++)
&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&& buf_1[j] = (byte)file.ReadByte();
&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& dbf.name = new byte[12];//分配12个空间,存储字段名
&&&&&&&&&&&&&&& Array.Copy(buf_1, dbf.name,11);
&&&&&&&&&&&&&&& dbf.type=buf_1[11];
&&&&&&&&&&&&&&& dbf.addr = buf_1[12];
&&&&&&&&&&&&&&& dbf.width=buf_1[16];
&&&&&&&&&&&&&&& dbf.deC = buf_1[17];
&&&&&&&&&&& }
&&&&&&&&&&& return 0;
&&&&&&& public int add_record(int fd_number,byte[] dat)//字段号(0~7),数据dat至少不小于字段长度,添加的字段一定要按顺序,添加之前得调用add_first();
&&&&&&&&&&& for (int i = 0; i & dbf[fd_number]. i++)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& if (dat == 0)
&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&& //
&&&&&&&&&&&&&&&&&&& dat = 0x20;
&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& file.WriteByte(dat);
&&&&&&&&&&& }
&&&&&&&&&& // file.WriteByte(0x1A);//写入最后的结束字节0x1A
&&&&&&&&&&& return 0;
&&&&&&& public void close()
&&&&&&&&&&& file.Close();
&&&&&&&&&&&
&&&&&&& public void read_fdname( int column, ref byte[] fildname)//读取字段名称,从0开始
&&&&&&&&&&& if (column & dbstr.fild_num - 1)//行号大于记录数目,返回
&&&&&&&&&&& {
&&&&&&&&&&&&&&&
&&&&&&&&&&& }
&&&&&&&&&&& fildname = dbf[column].
&&&&&&& public void read_fileds(int row,int column,ref byte[] fildname,ref byte[] data)//行号,列号,之前必须先调用opendbf,行号,列号都从0开始
&&&&&&&&&&& if ((row & dbstr.reCord-1) || (column & dbstr.fild_num-1))//行号大于记录数目,返回
&&&&&&&&&&& {
&&&&&&&&&&&&&&&
&&&&&&&&&&& }
&&&&&&&&&&& fildname = dbf[column].
&&&&&&&&&&& /*for (int i = 0; i & dbf[column].name.L i++)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& fildname = dbf[column].name;
&&&&&&&&&&& }*/&&&&
&&&&&&&&&&& file.Seek(dbstr.ldb + dbstr.lrd * row + dbf[column].addr, SeekOrigin.Begin);//文件指针移向字段的数据地址处
&&&&&&&&&&& for (int i = 0; i & dbf[column]. i++)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& data = (byte)file.ReadByte();
&&&&&&&&&&&&&&&
&&&&&&&&&&& }
&&&&&&& public void read_fileds(int row, int column, ref byte[] data)//行号,列号,之前必须先调用opendbf,行号,列号都从0开始
&&&&&&&&&&& if ((row & dbstr.reCord - 1) || (column & dbstr.fild_num - 1))//行号大于记录数目,返回
&&&&&&&&&&& {
&&&&&&&&&&&&&&&
&&&&&&&&&&& }
&&&&&&&&&&& file.Seek(dbstr.ldb + dbstr.lrd * row + dbf[column].addr, SeekOrigin.Begin);//文件指针移向字段的数据地址处
&&&&&&&&&&& for (int i = 0; i & dbf[column]. i++)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& data = (byte)file.ReadByte();
&&&&&&&&&&&&&
&&&&&&&&&&& }
&&&&&&& public int creatdbf(string path,string name,int len,ref DBF[] db)
&&&&&&&&&&& try
&&&&&&&&&&& {
&&&&&&&&&&&&&&& path +=
&&&&&&&&&&&&&&& FileInfo inf = new FileInfo(path);
&&&&&&&&&&&&&&& if (inf.Exists)//如果已经存在
&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&& return 1;
&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& else
&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&& FileStream file1= inf.Create();
&&&&&&&&&&&&&&&&&&& // = new FileStream(path, FileMode.Open, FileAccess.ReadWrite);
&&&&&&&&&&&&&&&&&&&& //file1.
&&&&&&&&&&&&&&&&&&&& file1.Seek(0,SeekOrigin.Begin);
&&&&&&&&&&&&&&&&&&&& file1.WriteByte(0x30);
&&&&&&&&&&&&&&&&&&&& file1.WriteByte((byte)(DateTime.Now.Year % 100));
&&&&&&&&&&&&&&&&&&&& file1.WriteByte((byte)DateTime.Now.Month);
&&&&&&&&&&&&&&&&&&&& file1.WriteByte((byte)DateTime.Now.Day);
&&&&&&&&&&&&&&&&&&&& file1.WriteByte(0);//记录数目0
&&&&&&&&&&&&&&&&&&&& file1.WriteByte(0);
&&&&&&&&&&&&&&&&&&&& file1.WriteByte(0);
&&&&&&&&&&&&&&&&&&&& file1.WriteByte(0);
&&&&&&&&&&&&&&&&&&&& short n = (short)(32 + 32 *len+ 1 + 263);&& //文件头长度,两个字节
&&&&&&&&&&&&&&&&&&&& file1.WriteByte((byte)n);//低字节
&&&&&&&&&&&&&&&&&&&& file1.WriteByte((byte)(n&&8));//高字节
&&&&&&&&&&&&&&&&&&&& n = 0;
&&&&&&&&&&&&&&&&&&&& for (int i = 0; i& i++) //记录长度,两个字节,等于每个字段的长度之和,最后加一,一代表的是记录标记0x20
&&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&&& n += db.
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& n += 1;
&&&&&&&&&&&&&&&&&&&& file1.WriteByte((byte)n);//低字节
&&&&&&&&&&&&&&&&&&&& file1.WriteByte((byte)(n && 8));//高字节
&&&&&&&&&&&&&&&&&&&& for (int i = 0; i & 20; i++)
&&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&&& file1.WriteByte(0);//写入系统保留的20个字节
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&& //至此,文件头填充完毕,开始写入各个字段信息
&&&&&&&&&&&&&&&&&&&& byte[] arr=new byte [32];
&&&&&&&&&&&&&&&&&&&& for (int i = 0; i & i++)
&&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&&& Array.Copy(db.name,arr,11);
&&&&&&&&&&&&&&&&&&&&&&&& arr[11] = db.
&&&&&&&&&&&&&&&&&&&&&&&& if (i == 0)
&&&&&&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&&&&&&& arr[12] = 1;
&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&& else
&&&&&&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&&&&&&& arr[12] += db[i - 1].
&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&&&&&& arr[16] = db.
&&&&&&&&&&&&&&&&&&&&&&&& for (int j = 0; j & 32; j++)
&&&&&&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&&&&&&& file1.WriteByte(arr[j]);
&&&&&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& file1.WriteByte(0x0D);//写入字段结束标记
&&&&&&&&&&&&&&&&&&&& for (int i = 0; i & 263; i++)//写入263个后链信息
&&&&&&&&&&&&&&&&&&&& {
&&&&&&&&&&&&&&&&&&&&&&&& file1.WriteByte(0);//
&&&&&&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&&&&&&& file1.Flush();
&&&&&&&&&&&&&&&&&&&& file1.Close();//关闭文件流
&&&&&&&&&&&&&&&&&&&& return 1;
&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&
&&&&&&&&&&& }
&&&&&&&&&&& catch
&&&&&&&&&&& {
&&&&&&&&&&&&&
&&&&&&&&&&&&&&& return 0;
&&&&&&&&&&& }
&&&&&&&&&&&
&&&&&&&&&&&
&&&&&&& public int modify_fields(int row, int column, ref byte[] data)//修改记录的字段数据
&&&&&&&&&&& if ((row & dbstr.reCord - 1) || (column & dbstr.fild_num - 1))//行号大于记录数目,返回
&&&&&&&&&&& {
&&&&&&&&&&&&&&& return 0;
&&&&&&&&&&& }
&&&&&&&&&&& file.Seek(dbstr.ldb + dbstr.lrd * row + dbf[column].addr, SeekOrigin.Begin);//文件指针移向字段的数据地址处
&&&&&&&&&&& for (int i = 0; i & dbf[column]. i++)
&&&&&&&&&&& {
&&&&&&&&&&&&&&& //data = (byte)file.ReadByte();
&&&&&&&&&&&&&&& file.WriteByte(data);
&&&&&&&&&&& }
&&&&&&&&&&
&&&&&&&&&&&
&&&&&&&&&&& return 1;
主题帖子精华
在线时间510 小时
呵呵,楼主上传界面图比教直观点.
我是开源电子网站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺:
微信公众平台:正点原子
主题帖子精华
初级会员, 积分 85, 距离下一级还需 115 积分
在线时间0 小时
呵呵,这个比较适合在嵌入式wince中用,图片没时间整。已经在项目中用了,程序是没问题。
主题帖子精华
在线时间510 小时
对wince没用过...
我是开源电子网站长,有关站务问题请与我联系。
正点原子STM32开发板购买店铺:
微信公众平台:正点原子
Powered by无锡伊斯特教育考试中心 全国计算机等级考试 全国英语等级考试
东方教育网
公共英语 无锡伊斯特考试中心 无锡计算机考试成绩查询 无锡计算机二级 计算机等级培训,一级OFFICE 二级VFP、二级VB、二级OFFICE高级应用、二级ACCESS、C培训,
焦点图标题层
      
     
      
      
      
全国计算机等级考点编号:320058
全国英语等级考试编号:320220&国家工业和信息化部ICP许可证:&
总访问量:人&&&&联系电话:5
&& 版权所有:无锡市伊斯特教育培训中心君,已阅读到文档的结尾了呢~~
计算机技术基础(vfp)
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
计算机技术基础(vfp)
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口君,已阅读到文档的结尾了呢~~
档案的压缩与打包_5vi应用(可编辑),照片怎么压缩打包,怎么把照片压缩打包,如何打包压缩文件,文件怎么压缩打包,照片打包压缩,怎样把文件压缩打包,linux打包压缩命令,压缩打包机,文件打包压缩
扫扫二维码,随身浏览文档
手机或平板扫扫即可继续访问
档案的压缩与打包_5vi应用(可编辑)
举报该文档为侵权文档。
举报该文档含有违规或不良信息。
反馈该文档无法正常浏览。
举报该文档为重复文档。
推荐理由:
将文档分享至:
分享完整地址
文档地址:
粘贴到BBS或博客
flash地址:
支持嵌入FLASH地址的网站使用
html代码:
&embed src='/DocinViewer-4.swf' width='100%' height='600' type=application/x-shockwave-flash ALLOWFULLSCREEN='true' ALLOWSCRIPTACCESS='always'&&/embed&
450px*300px480px*400px650px*490px
支持嵌入HTML代码的网站使用
您的内容已经提交成功
您所提交的内容需要审核后才能发布,请您等待!
3秒自动关闭窗口

我要回帖

更多关于 vfp新建远程视图 的文章

 

随机推荐