|
Dim Conn As New ADODB.Connection
Dim Rst As New ADODB.Recordset
Dim NetRst As New ADODB.Recordset
Dim NetConn As New ADODB.Connection
Dim Server As String
Dim sql As String
Server = "\\Dateserver\Access<\数据库\数据分析主体.mdb"
Set Conn = CurrentProject.Connection
NetConn = "rovider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Trim(Server) + ";"
sql = "select * from 排单表"
NetRst.Open "select * from 排单表", NetConn, adOpenDynamic, adLockOptimistic
Rst.Open sql, Conn, adOpenDynamic, adLockOptimistic
'把记录写到本地表
Do While Not NetRst.EOF
Rst.AddNew
Rst.Fields("A") = NetRst.Fields("A")
Rst.Update
NetRst.MoveNext
Loop
Set NetRst = Nothing
Set Rst = Nothing
|
|