站长交易(http://jy.chinaz.com)帮站长赚钱 虚拟主机评测+IDC导航=IDC123.COM 使用Access数据库生成申报数据与读入数据的实例方法: 示例: [table] [tr] 以下为引用的内容:Sub Mwrite()On Error GoTo thiserrDim rs As New ADODB.Recordsetrs.Open "dlmd", CurrentProject.Connection, adOpenDynamic, adLockOptimistic, acTablers.Save "a:\dlmd.adtg", adPersistADTGrs.CloseSet rs = Nothingthisexit:Exit Subthiserr:MsgBox Err.DescriptionResume thisexitEnd SubSub Mread()On Error GoTo MerrDim i As IntegerDim rsDe As New ADODB.RecordsetDim rsSo As New ADODB.RecordsetrsSo.Open "a:\dlmd.adtg", "provider=mspersist"rsDe.Open "dlmd", CurrentProject.Connection, adOpenKeyset, adLockOptimistic, acTableDo Until rsSo.EOFrsDe.AddNewFor i = 0 To rsSo.Fields.Count - 1rsDe.Fields(i) = rsSo.Fields(rsDe.Fields(i).Name)Next irsDe.UpdatersSo.MoveNextLooprsSo.ClosersDe.CloseSet rsSo = NothingSet rsDe = NothingMexit:Exit SubMerr:MsgBox Err.DescriptionResume MexitEnd Sub [/td] [/tr] [/table] 183101