With Adodc1 .ConnectionString = "DSN=?" .CommandType = adCmdUnknown .RecordSource = "sql" .Refresh End With
With Adodc1.Recordset name = .Fields("name") End With
With Adodc2 .ConnectionString = "DSN=abc" .CommandType = adCmdUnknown .RecordSource = "sql" .Refresh End With With Adodc2.Recordset
If .RecordCount = 0 Then With Adodc2 .CommandType = adCmdTable .RecordSource = "table" .Refresh End With Dim xmmc As String Do While Adodc1.Recordset.EOF = False
.AddNew .Fields("name").Value = Adodc1.Recordset.Fields("name") Adodc1.Recordset.MoveNext Loop End If End With 大概就是这样了!试试看吧
.ConnectionString = "DSN=?"
.CommandType = adCmdUnknown
.RecordSource = "sql"
.Refresh
End With
With Adodc1.Recordset
name = .Fields("name")
End With
With Adodc2
.ConnectionString = "DSN=abc"
.CommandType = adCmdUnknown
.RecordSource = "sql"
.Refresh
End With
With Adodc2.Recordset
If .RecordCount = 0 Then
With Adodc2
.CommandType = adCmdTable
.RecordSource = "table"
.Refresh
End With
Dim xmmc As String
Do While Adodc1.Recordset.EOF = False
.AddNew
.Fields("name").Value = Adodc1.Recordset.Fields("name")
Adodc1.Recordset.MoveNext
Loop
End If
End With
大概就是这样了!试试看吧