开发者

Visual Basic 6.0 Code generator

开发者 https://www.devze.com 2023-01-21 09:28 出处:网络
I have a MS Sql 2005 Database , and I want to gene开发者_如何学Gorate Visual BAsic code of Data Entity Class, I search the web but I can find a tool that I want. If you any information or link please

I have a MS Sql 2005 Database , and I want to gene开发者_如何学Gorate Visual BAsic code of Data Entity Class, I search the web but I can find a tool that I want. If you any information or link please help me.


I've heard that Enterprise Architect has an entity/ORM framework generator for VB6, but I can't say for sure. I suggest you start looking there. reference

I had to roll my own at work, but it's copyrighted by the company so I wouldn't be able to post it here. I can give you a brief synopsis if you want to try it yourself:

  • I created a "base class" for an entity (VB6 doesn't support inheritance, so this was actually a "wrapped" base class)
    • Has Methods like Insert, Update, LoadByPrimaryKey, etc.
  • I created a similar "base class" for a collection of entities.
    • Supports simple .Where and .OrderBy methods that build a query
  • I created a code generator that pulled a list of tables from the database
    • It generates a module for each table with an Enum listing each column name as an ID, and lookup tables to go from column enum to column name, and back
    • It generates an entity class for each table that wraps the base entity, and has property setters/getters corresponding to each column name
    • It generates an entity collection class for each table that wraps the base collection class
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号