用adodb怎么连接一个dbf文件?
怎样连接import.dbf文件。
do while ....
FileCopy App.Path & "\EXPVCH.STD", App.Path & "\Import.dbf" '权限07
Dim rsdbf As ADODB.Recordset
Dim condbf As ADODB.Connection
Set rsdbf = New ADODB.Recordset
Set condbf = New ADODB.Connection
Dim strCnnImport As String
strCnnImport = "Provider=MSDASQL.1;Persist Security Info=False;Data Source=dBASE Files;Initial Catalog=" & App.Path
condbf.ConnectionString = strCnnImport
rsdbf.Open "select * from import", condbf, adOpenKeyset, adLockOptimistic
'上行有错。
rsdbf.addnew
....
rsdbf.update
loop
--------------------------
运行上面的代码,提示错误:
实时错误'3709'
the Connection cannot be used to perform this operation.
Tt is either closed or invalid in this context.
--------------------------
正确的连接方法要怎么写?对不同的版本dbf文件,是否有不同的写法??
最好是完全用代码的方法来写!因为这具import.dbf文件是临时生成的,还有,它可能是dbfIII文件,(但也可能不是这个版本,我不能决定!)