| 发表于:2007-04-28 11:04:221楼 得分:0 |
rstrecordsetdbf.open "select * from pz01 ", conconnection, adopenkeyset, adlockoptimistic while not rstrecordset.eof rstrecordsetdbf.addnew for lngindex = 0 to rstrecordset.fields.count - 1 if lngindex = 0 then rstrecordsetdbf.fields(lngindex) = format(rstrecordset.fields(lngindex), "yyyy/mm/dd ") rstrecordsetdbf.fields(lngindex) = left(rstrecordsetdbf.fields(lngindex), 4) & "/ " & mid(rstrecordsetdbf.fields(lngindex), 6, 2) & "/ " & right(rstrecordsetdbf.fields(lngindex), 2) else rstrecordsetdbf.fields(lngindex) = iif(isnull(rstrecordset.fields(lngindex)), " ", trim(rstrecordset.fields(lngindex))) end if next rstrecordsetdbf.update rstrecordset.movenext wend 第一行是连接到dbf数据库 后面是将在sql数据库中,读取的数据,依次写入到dbf数据库中 | | |
|