使用vb6将datagrid中的数据保存在文本文件中 [英] save data from datagrid in text file using vb6

查看:236
本文介绍了使用vb6将datagrid中的数据保存在文本文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在vb6中构建了datagrid.现在我的问题是我不知道如何将datagrid中的数据保存到文本文件中.有人可以帮助我吗?谢谢.

I already build the datagrid in vb6. Now my problem is i don''t know how to save the data in datagrid into the textfile. Anyone can help me? Thanks.

推荐答案

保存到文本文件中就是这样


Saving into text file will be like this


''Open the File with a handler #1

Open "c:\xx.txt" for output as #1

Do  While ...
  '''''' ......
  '''''''' Create your line to be printed strLine
  ''Write a single line
  Print #1, strLine
  '''''''''' ...
Loop

''Close the file

Close #1



现在尝试一下.我已经很长时间没有使用这些代码了.



Now try yourself. I havent use these codes a long time.


您可能会在网上找到一些教程和示例.例如,请参见此处 [
You may find several tutorials and samples on the net. See for instance here[^].
:)


这篇关于使用vb6将datagrid中的数据保存在文本文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆