4

我正在使用 ms-access 开发数据库管理的前端解决方案。我必须承认 ms-access VBA 对大型应用程序的开发是一个坚实的限制,这就是为什么我一直在改变使用 c# 而不是 VBA 的想法。

事实上,很容易摆脱 ms-access 中的所有内容,除了一个东西:表单。这些在数据显示和编辑方面特别快速和高效。在最新版本的 ms-access 中,表单的行为类似于类,因此您可以在运行时专门管理同一表单的一个或多个实例。在连续模式下使用时,它们可用于“以 excel 方式”操作数据,具有行和列显示、过滤和排序的可能性。简而言之,我喜欢它。

当然可以在 c#(或其他类似语言)下对该表单对象进行逆向工程,但这可能已经完成:您是否曾经使用过库、activeX 控件或任何其他类型的附加组件可以在 c# 中操作类似 msacces 的表单吗?

编辑:根据 Renaud 的评论,我承认仅转换表单的布局部分没有兴趣,也无法转换其自定义/VBA 部分。在我们的具体情况下,我们很久以前就停止在表单中使用自定义的 VBA 代码了,表单的属性、方法和事件都是从模块中管理的。这甚至在这里讨论过

事实上,我们所有的表单都依赖于一个通用模板,并且自动构建在一个“表单”和一个“控件”表之外。所有底层事件管理代码的生成都是自动化的:根据它们的类型,控件与选定的事件相关联,并且事件的代码提供给应用程序模块中保存的标准\通用过程。这就是让我认为可以将我们的“ms-access 表单技术”转移到 .NET 平台的原因。

4

1 回答 1

6

我不知道有任何项目可以让您使用 Access 应用程序并在 .Net 或其他任何东西中重建它。我相信有一些很好的理由说明这些工具只能提供非常有限的功能。

仅转换表单布局的工具将非常缺乏用途:在 .Net 中手动(重新)创建功能布局非常容易,无论是 WinForms 还是 WPF。
每个屏幕可能需要几个小时,但速度足够快,可行。

但是,自动化工具很难将 Access 表单翻译成在 .Net 中看起来不错:
许多 Access 应用程序在 UI 方面设计不佳,控件位置选择不佳,依赖自定义配色方案和技巧来弯曲有限访问控制一个人的意志。
最重要的是,您有很多非常特定于 Access 的对象属性,如果不需要大量额外的支持代码,就无法很好地转换为 .Net。

But I think the elephant in the room is VBA: most complex Access forms are customized with VBA controlling the UI and Business logic, and that can't be translated into .Net without some significant efforts.
The fact that MS Access apps are built around a procedural, module-centric approach rather than object oriented, and that Access apps invariably have very poor separation of UI and Business logic, doesn't help the cause.
Direct translation -if it was possible at all- would just create a crappy .Net application.

There are frameworks for building simple/complex business apps that are similar to Access in many ways.

Developer Express have eXpressApp Framework which allows you to build and customize UI, generating the database, manage users, security, etc and will easily allow you to construct data views with close to no code (you can add as much code as you need though, it's all .Net). The UI uses their excellent controls, which are far superior in terms of behaviour and being customizable than those in Access.
That framework targets both desktop and web (you make a single project and you get both automatically). Alas, it's not really cheap you must have a Universal Subscription that costs $2200 at this date (yearly renewal is $800).

Another product, free or cheap, depending on your MSDN subscription, is LightSwitch.
LightSwitch is being viewed by some as a modern, developer-centric- successor of Access. It was originally targeting Silverlight for easy deployment in the enterprise, but recent versions are also targeting HTML5, so you can 'run your app anywhere', even tablets.
The principle here is to easily construct decent data-oriented forms and views that allow fast data entry and customized reports.

Like you, I regularly think about how existing MS Access apps could be converted into .Net, but the more I think about the details, the hairier it gets, and then you look at what people have been doing with Access, and you know that for any tool to be successful, it would have to handle all the horrible ways that office users have constructed their apps, and that's just insane.
There are just too many ways to build an Access application, and most of them are very poor and have no chance of allowing an easy conversion without changing paradigm completely, usually forcing a complete rewrite.

于 2013-03-31T07:58:29.003 回答