在我的电脑上可以运行,但换了电脑则报错。
提示:-2147467259(800040051)
[microsoft][odbc 驱动程序管理器] 驱动程序不支持此功能
Dim cn As New adodb.Connection
Dim foxrs As New adodb.Recordset
  Dim cnstr As String
  Dim mypath As String
mypath = App.Path
  cnstr = "Driver={Microsoft Visual FoxPro Driver};" & _
           "SourceType=DBF;" & _
            "SourceDB= " & mypath & ""
If cn.State = 1 Then
  cn.Close
End If
        
cn.Open cnstr
cn.BeginTrans
cn.Execute "delete from Nyglsjzc.dbf "
cn.Execute "insert into Nyglsjzc.dbf values(……)
cn.CommitTrans
rs.MoveNext
Loop
cn.Close
rs.Close

解决方案 »

  1.   

    换了电脑可能要部署VFP的DLL,拷贝一个VFPODBC.DLL过去试试看!
      

  2.   

    您好!
    我昨天去装了一下,但当另外一个窗体显示,用驱动列表,和目录列表,foxpro表复制,仍提示   "运行时的错误'70',拒绝的权限."  代码如下:
    Dim copyto As String
    Private Sub Command1_Click()
    copyto = InputBox("要保存的文件名:", "数据输出", "123456.dbf")
    If copyto = "" Then
    Exit Sub
    End If
    strsource = App.Path & "\123456.dbf"
    strdestination = Dir1.Path & copyto
    FileCopy strsource, strdestination
    end sub
    把vb装上后,提示"编译错误,找不到工程和库" 
    Dim rs As Recordset  '此地方提示
    Dim rsqt As Recordset
    我去另外的两台电脑上运行了一下,一台没出现上面提到的两个问题,一台出现.
    我vb学了没多久,谢谢高手指教!