不必啦!
用ACCESS数据库也可以,
引用DAO 

解决方案 »

  1.   

    或都引用ADO,都可以调用SQL语句!
      

  2.   

    Dim adorecordset As New ADODB.Recordset
    Dim adoconnection As New ADODB.Connection
    Dim cstring As String
    dim strsql as string
    cstring = "DRIVER={Microsoft Access Driver (*.mdb)};" & _
    "DBQ=数据库路径;"
    strsql = "select * from 表名"
    adorecordset.Open strsql, adoconnection, adOpenDynamic, adLockOptimistic
    以上使用的是ado连接access库的方法,不明白的看看msdn吧
      

  3.   

    DAO:
    DIM RC AS RECORDSET
    DIM SQLSTR AS STRING
    SQLSTR="SELECT ....... WHERE....."
    SET RC=DATA1.DATABASE.OPENRECORDSET(SQLSTR)
    SET DATA1.RECORDSET=RC
    ......
      

  4.   

    Dim rs1 As New ADODB.Recordset
    Dim cmd1 As New ADODB.Command
    Public cn As New ADODB.Connection
    const aa="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;Initial Catalog=你的库名;Data Source=你的主机名称"cn.open aa
    Set cmd1.ActiveConnection = cn
    cmd1.CommandText = "SELECT * from 表名"
    rs1.CursorLocation = adUseClient
    rs1.Open cmd1, , adOpenKeyset, adLockPessimistic
    Set Adodc1.Recordset = rs1以上用的是ADO控件来绑定SQL数据库,明白吗?