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

前端 未结 12 2285
我在风中等你
我在风中等你 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:18

    I do this all the time. If you're using ADO, you're not really using Access, but Jet, the underlying database. That means anybody with Excel can use the app - Access not required. Oh I should mention, the place I work bought a bunch of Office Small Business licenses - no Access. Prior to working here, I would have assumed that anyone who had Excel would also have Access. Not so.

    I create one class for every table in Access. I very rarely run queries through ADO, instead I keep that logic in the class modules. I read in with a SELECT statement and write out with and UPDATE or INSERT using the Execute method of the ADODB.Connection object.

    See http://www.dailydoseofexcel.com/archives/2008/12/21/vba-framework-ii/

    if you want to see how I set up my code.

    To answer your questions: It will be a small learning curve for you if you already know Excel VBA, but there will be some learning to do; you will pay a performance penalty over doing it all in Access, but it's not that bad and only you can decide if it's worth it; and you can have multiple people accessing the database.

提交回复
热议问题