文件名称:vbaccesstotxt
- 所属分类:
- Windows编程
- 资源属性:
- [Windows] [Visual C] [Basic/ASP] [源码]
- 上传时间:
- 2014-05-05
- 文件大小:
- 4kb
- 下载次数:
- 0次
- 提 供 者:
- cpu***
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
将Access表中的数据内容按一定格式存储到Txt文件中,D:\Program Files\Microsoft Visual Studio\VB98,如果你的VB6不是安装在此位置,请修改代码中的路径为你的实际位置,测试结束后请记着关闭数据库引擎。需要说明的地方:
输入字段名称后换行:
Data1.Recordset.MoveFirst
Do While Not Data1.Recordset.EOF
For Each fld In Data1.Recordset.Fields
Print #1, fld.Value ", "
不换行
Next
此循环将当前记录的所有字段的值写入文件
Print #1, Chr(13)
Data1.Recordset.MoveNext
输入换行符后将下一条记录设置为当前记录
Loop
此Do-While选换写入所有记录
Close #1 关闭文件
End Sub-Access to the data content stored in the table according to a certain format to Txt file, D: \ Program Files \ Microsoft Visual Studio \ VB98, if your VB6 is not installed in this location, modify the code in the path of your actual position, Remember to turn off after the end of the test database engine. Caveats: the name of the input field wrap: Data1.Recordset.MoveFirst Do While Not Data1.Recordset.EOF For Each fld In Data1.Recordset.Fields Print# 1, fld.Value " ," ' No Wrap Next' This cycle values for all fields of the current record written to the file Print# 1, Chr (13) Data1.Recordset.MoveNext ' input newline after setting a record for the current record Loop' This Do-While toggle write all Record Close# 1 ' close the file End Sub
输入字段名称后换行:
Data1.Recordset.MoveFirst
Do While Not Data1.Recordset.EOF
For Each fld In Data1.Recordset.Fields
Print #1, fld.Value ", "
不换行
Next
此循环将当前记录的所有字段的值写入文件
Print #1, Chr(13)
Data1.Recordset.MoveNext
输入换行符后将下一条记录设置为当前记录
Loop
此Do-While选换写入所有记录
Close #1 关闭文件
End Sub-Access to the data content stored in the table according to a certain format to Txt file, D: \ Program Files \ Microsoft Visual Studio \ VB98, if your VB6 is not installed in this location, modify the code in the path of your actual position, Remember to turn off after the end of the test database engine. Caveats: the name of the input field wrap: Data1.Recordset.MoveFirst Do While Not Data1.Recordset.EOF For Each fld In Data1.Recordset.Fields Print# 1, fld.Value " ," ' No Wrap Next' This cycle values for all fields of the current record written to the file Print# 1, Chr (13) Data1.Recordset.MoveNext ' input newline after setting a record for the current record Loop' This Do-While toggle write all Record Close# 1 ' close the file End Sub
(系统自动生成,下载前可以参看下载内容)
下载文件列表
将Access表中数据按一定格式存储到Txt文件\DataProject.vbp
.......................................\DataProject.vbw
.......................................\frmDataEnv.frm
.......................................\frmDataEnv.frx
将Access表中数据按一定格式存储到Txt文件