从DBF到MDB?
我从dbf文件中复制所有记录到MDB表中
Dim cnACC As New ADODB.Connection
Dim strSQL As String
Dim strDBF As String
Dim strMDB As String
Dim DBFTable As String
Dim MDBTable As String
strDBF =App.Path
DBFTable ="data.dbf"
strMDB =App.Path & "\Source.mdb"
MDBTable ="data"
With cnACC
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Properties("Data Source") = strMDB
.Mode = adModeReadWrite
.Open
End With
strSQL = "SELECT * INTO " & MDBTable & " FROM [dBASE III;DATABASE=" & strDBF & "]." & DBFTable
cnACC.Execute strSQL '运行到这里的时候提示“不能定位所需的Xbase备文件”,什么原因呢?
cnACC.Close