我想连接到excel文件,
请问如何设置adodc控件的属性?然后一些简要的查询如何操作?就像excel中的find函数一样,如何查找数据?
有例子更好了.
谢谢

解决方案 »

  1.   

    是不是可以考虑adodb对象?
    简单方便
      

  2.   

    sql = "select * from [SheetLabelName$]"
      With Adodc
        .ConnectionString = "provider=microsoft.jet.oledb.4.0;persist security info=false;" & _
                            "data source=" & PathName & ";extended properties='" & _
                            "excel 8.0;hdr=yes'"
        .CommandType = adCmdText
        .RecordSource = sql
        .Refresh
      End With
    只是ConnectionString与连接数据库有所不同,其它操作一样的
      

  3.   

    二、利用adodc(ADO Data Control)进行数据库链接:
    private form_load ()
    Dim str As String '定义
    str = App.Path
    If Right(str, 1) <> "\" Then
    str = str + "\"
    End If
    str = "Provider=Microsoft.Jet.OLEDB.3.51;Persist Security Info=False;Data Source=" & str & "\tsl.mdb"
    Adodc1.ConnectionString = str
    Adodc1.CommandType = adCmdText
    Adodc1.RecordSource = "select * from table3"
    Adodc1.Refresh
    end sub
      

  4.   

    http://shareware.4urneed.com/VB/vb-3.htm
      

  5.   

    http://taoyuan.webhostme.com/download/
      

  6.   

    http://www.easywise.com/learn/programme/less003vb.htm