定义自定义类型
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
请问怎样把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
反之,把数据库的字段转换成上述文本格式。请务必详细!
定义自定义类型
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