数据库-文本转换

yining 2000-02-29 10:38:00
请问怎样把access数据库中的数据表转换成文本文件,表中的每一个字段在文本中用特定的格式区分开来,或反过来把文本中用特定的格式区分的数据转换成access数据库中的表。能否提供详细的源代码。谢谢!(注:不用导入导出的方法实现)
...全文
121 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yining 2000-03-06
  • 打赏
  • 举报
回复
在文本转换为数据库的过程中怎样把以 ” and ”分开的字符串,分别还原成数据库的字段。在数据库转换为文本的过程中怎样把文本中字符前的引号去掉。(问题没重复)
MarsXia 2000-03-02
  • 打赏
  • 举报
回复
db=>text
假定数据库字段定义如下:
id user pass

定义自定义类型
type textdb
id as long
sp1 as string*5
user as string*10
sp2 as string*5
pass as string*10
end type

dim sp as string
sp="and"
open textfile
open database
open recordset
do until recordset.eof
get current record
textdb.id=id
textdb.sp1=sp
textdb.user=user
textdb.sp2=sp
textdb.pass=pass

write textdb to textfile opened
loop
close recordset
close database
close textfile

text=>db
反向操作就可以了
----------------------
其实,稍微转过弯一想就成了
yining 2000-03-02
  • 打赏
  • 举报
回复
请问怎样把access数据库中的数据表转换成文本文件,表中的每一个字段在文本中用特定的格式区分开来,或反过来把文本中用特定的格式区分的数据转换成access数据库中的表。能否提供详细的源代码。谢谢!(注:不用导入导出的方法实现)
例如:把文本中用“ and ”隔开的数据转换成数据库中相应字段的记录
32022 and 42068625901013562101 and 李惠芳 and 75.25 and 0
32023 and 42068625901013577401 and 高小毛 and 70.4 and 0
32024 and 42068625901013583001 and 温太平 and 138.6 and 0
72007 and 42068625901000853601 and 毛世友2 and 86.69 and 0
反之,把数据库的字段转换成上述文本格式。请务必详细!
subzero 2000-03-01
  • 打赏
  • 举报
回复
很简单吗
db=>text
假定数据库字段定义如下:
id user pass

定义自定义类型
type textdb
id as long
user as string*10
pass as string*10
end type

open textfile
open database
open recordset
do until recordset.eof
get current record
textdb.id=id
textdb.user=user
textdb.pass=pass
write textdb to textfile opened
loop
close recordset
close database
close textfile

text=>db
反向操作就可以了

1,216

社区成员

发帖
与我相关
我的任务
社区描述
VB 数据库(包含打印,安装,报表)
社区管理员
  • 数据库(包含打印,安装,报表)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧