Map BO to MS Access view


Author
Message
Alex Bibiano González
Alex Bibiano González
StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)StrataFrame Beginner (31 reputation)
Group: Forum Members
Posts: 31, Visits: 125
Can I mapp a BO to a MS Access view?

I have the BO, the view in the mdb, but if I call the BO Mapper tool, only tables are displayed.

Is it possible?

Thanks,

Alex B.

Replies
Edhy Rijo
E
StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)StrataFrame VIP (6.4K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Alex Bibiano González (03/17/2008)
Thanks for your replays. I will try your suggestion but I need a little more help.

I have read the link, but don't understand where to put the query in my BO:

SELECT Staff.*, SchoolTitles.TitleName FROM Staff INNER JOIN SchoolTitles ON Staff.ForeignKey = SchoolTitles.PrimaryKey

Can I retrieve in my fill method more columns than the columns I mapped in the BO mapper?

Can I create a BO with all fields as custom properties? (because my BO don't maps directly to a table, and I can't use the BO mapper tool)

Thanks and excuse for my ignorance

Alex B.

Hi Alex,

No problem, so here we go.....

  1. In the Solution Explorer, right click your BO file and select View Code
  2. Open the Region "Data Retrieval Methods" and create a method here which you will call from anywhere in your form, so let's named it something like GetStaffView and the code should be something like this in VB:

Public Sub GetStaffView()

     Me.FillDataTable("SELECT Staff.*, SchoolTitles.TitleName FROM Staff INNER JOIN SchoolTitles ON Staff.ForeignKey = SchoolTitles.PrimaryKey")

End Sub

You will then call the Me.GetStaffView method from your form's New or Load event or from any other place you want the BO to be populated.

I believe you will also need to create a Custom Field Property to manage the SchoolTitles.TitleName, but I am not sure, so if that is the case let me know to give you some code to do that, or look at the help for the Custom Field Property topic, so you can add it in the same BO file.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
Yup. Edhy is right on the money.  You will just create a method within your BO that executes that query for you.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search