很简单吗
db=>text
假定数据库字段定义如下:
id user pass定义自定义类型
type textdb
id as long
user as string*10
pass as string*10
end typeopen 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 textfiletext=>db
反向操作就可以了
db=>text
假定数据库字段定义如下:
id user pass定义自定义类型
type textdb
id as long
user as string*10
pass as string*10
end typeopen 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 textfiletext=>db
反向操作就可以了
例如:把文本中用“ 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
反之,把数据库的字段转换成上述文本格式。请务必详细!
假定数据库字段定义如下:
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 typedim 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=passwrite textdb to textfile opened
loop
close recordset
close database
close textfiletext=>db
反向操作就可以了
----------------------
其实,稍微转过弯一想就成了