方法:
'1.打开本地库Loacal.mdb
If fs.FileExists("c:\Loacal.mdb") = False Then
Dim db As Database
Set db = CreateDatabase("c:\Loacal.mdb", dbLangGeneral)
Set db = Nothing
End If
'2.与SQL Server的连接
ConnectString = "[ODBC;Driver={SQL Server};SERVER=" & DBName & "Server;DATABASE=" & DBName & ";UID=sa;PWD=]"
'3.执行语句
Dim rs As New ADODB.Recordset
SQL = "select * into 本地库的表 from " & ConnectString & ".服务器端表 "
& " where 条件"
rs.Open SQL, LocalCn, adOpenDynamic, adLockBatchOptimistic '4。此为批量插入,本地库必须已建好,表可以没有
'1.打开本地库Loacal.mdb
If fs.FileExists("c:\Loacal.mdb") = False Then
Dim db As Database
Set db = CreateDatabase("c:\Loacal.mdb", dbLangGeneral)
Set db = Nothing
End If
'2.与SQL Server的连接
ConnectString = "[ODBC;Driver={SQL Server};SERVER=" & DBName & "Server;DATABASE=" & DBName & ";UID=sa;PWD=]"
'3.执行语句
Dim rs As New ADODB.Recordset
SQL = "select * into 本地库的表 from " & ConnectString & ".服务器端表 "
& " where 条件"
rs.Open SQL, LocalCn, adOpenDynamic, adLockBatchOptimistic '4。此为批量插入,本地库必须已建好,表可以没有
大力先生可能没有看懂我的意思,我要求是用编程实现
等问题解决了我就散分!