Using Excel as front end to Access database (with VBA)

前端 未结 12 2118
我在风中等你
我在风中等你 2021-01-30 17:42

I am building a small application for a friend and they\'d like to be able to use Excel as the front end. (the UI will basically be userforms in Excel). They have a bunch of dat

12条回答
  •  梦如初夏
    2021-01-30 18:24

    It's quite easy and efficient to use Excel as a reporting tool for Access data. A quick "non programming" approach is to set a List or a Pivot Table, linked to your External Data source. But that's out of scope for Stackoverflow.
    A programmatic approach can be very simple:

    strProv = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & SourceFile & ";"
    Set cnn = New ADODB.Connection  
    cnn.Open strProv
    Set rst = New ADODB.Recordset
    rst.Open strSql, cnn
    myDestRange.CopyFromRecordset rst
    

    That's it !

提交回复
热议问题