使用access数据库生成申报数据与读入数据的实例方法:
示例:
以下为引用的内容: sub mwrite() on error goto thiserr dim rs as new adodb.recordset rs.open "dlmd", currentproject.connection, adopendynamic, adlockoptimistic, actable rs.save "a:/dlmd.adtg", adpersistadtg rs.close set rs = nothing thisexit: exit sub thiserr: msgbox err.description resume thisexit end sub sub mread() on error goto merr dim i as integer dim rsde as new adodb.recordset dim rsso as new adodb.recordset rsso.open "a:/dlmd.adtg", "provider=mspersist" rsde.open "dlmd", currentproject.connection, adopenkeyset, adlockoptimistic, actable do until rsso.eof rsde.addnew for i = 0 to rsso.fields.count - 1 rsde.fields(i) = rsso.fields(rsde.fields(i).name) next i rsde.update rsso.movenext loop rsso.close rsde.close set rsso = nothing set rsde = nothing mexit: exit sub merr: msgbox err.description resume mexit end sub |
新闻热点
疑难解答