An instance method of data passing in Access database

Source: Internet
Author: User
Tags exit goto instance method access database access

Use an Access database to generate an instance method of reporting data and reading data:

Example:

The following are the referenced contents:
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



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.