Question n-tiered application (1 Viewer)

mcdhappy80

Registered User.
Local time
Tomorrow, 00:14
Joined
Jun 22, 2009
Messages
347
I was wondering can 3-tiered architecture be implemented in a standard access 2007 VBA application?
If it can, would i use ADO for connection to database?
Would queries act as stored procedures?
For the record, I'm not talking about using access as FE to SQL server or MySQL or Oracle, I'm talking about Access to Access FE - BE.
Can this be done?
Also, what data structures can I use in Access VBA, I need something like Vector in Java, is there such data structure in Access VBA?
Thank You
 

MarkK

bit cruncher
Local time
Today, 15:14
Joined
Mar 17, 2004
Messages
8,190
1) You can absolutely write a three tiered app in VBA. Encapsulate your business logic in VBA Class modules.
2) Whether you use ADO or DAO has no impact on the application architecture, so you can write a three tiered app with either one, both, or neither.
3) Queries can act in a limited way like SQL Server stored procedures, but you are not able to execute multiple instructions in a single Access query. This being the case, it's most likely you'd implement any complex business logic in VBA in your middle tier.
4) After Googling it, Vector looks a like a VBA.Collection. Check out the VBA object model in the object browser. You might also look into the Microsoft Scripting Runtime, which has a Scripting.Dictionary object that's pretty handy too.
Cheers,
 

Banana

split with a cherry atop.
Local time
Today, 15:14
Joined
Sep 1, 2005
Messages
6,318
It's my view that Access itself does not really lend itself for a n-tiered architecture. I'm not saying it's not possible; just not cost-effective and requires swimming upward.

Mind, Access does admirably in a 2-tiered architecture (e.g. client-server architecture). To take the next step and go n-tiered requires that we write a library between the server and client. The whole point of building n-tiered architecture is to enable consumers to change backends and work with more than one clients. So, if we had requirement to provide same application in a web browser, in a rich client, or even two different clients (e.g. one client optimized for Windows, other for *nix perhaps) and/or we wanted to be able to deploy this application to any environment regardless of whether they're running SQL Server, Oracle, PostgreSQL or MySQL.... that's when we really need a n-tiered architecture. I know you've mentioned you want Access FE - Access BE but that'd argue against the need for n-tiered architecture precisely because of lack of need to deploy application on different platforms.

As lagbolt pointed out, it is certainly possible to build an Access application as a client in a n-tiered architecture if your middle tier can be consumed by Access (which implies that the library must be a COM DLL) or perhaps exposing objects as ODBC or OLEDB objects thus enabling you to keep as much as logic you can in the library. The latter would certainly increase the complexity and requirement, perhaps too much to justify that the former method and thus undergoing the benefits of bound forms and using VBA to drive everything may be easier to implement. But if we choose to forsake bound forms, the next question then become "Why even bother with Access? Might as well go and do it in Visual Studio."

Indeed, the whole strength of Access rests in the bound forms and thus RAD aspect. N-tiered architecture does not mesh with RAD very well, hence my position that Access wouldn't really make for a good n-tiered client.

The increase of complexity from a client-server architecture to n-tiered architecture is quite big, and we also need to consider the case of time to market. Many times, Access applications are made because there is a business requirement that should be met yesterday. Indeed, several Access applications out there were born in response to IT's hand waving, saying it'd be months before they wrote out a "real application" but they can't wait months. Then there's also the additional problem of changing requirement. A feature request is easier done in a client-server architecture but quite expensive in a n-tiered architecture.

There are times and places for a n-tiered architecture and when the requirement is justified, they are excellent solutions. But if it's not really needed, it's a good way to burn money and time.

It boils down to this: Just because we can, doesn't mean we should.
 

HiTechCoach

Well-known member
Local time
Today, 17:14
Joined
Mar 6, 2006
Messages
4,357
I was wondering can 3-tiered architecture be implemented in a standard access 2007 VBA application?
If it can, would i use ADO for connection to database?
Would queries act as stored procedures?
For the record, I'm not talking about using access as FE to SQL server or MySQL or Oracle, I'm talking about Access to Access FE - BE.
Can this be done?
Also, what data structures can I use in Access VBA, I need something like Vector in Java, is there such data structure in Access VBA?
Thank You


Access using the JET/ACE database engine is file/server based not client/sever AFAIK the JET/ACE database engine can not be run as a stand alone server.

To have an n-Tier Architecture requires client/server software.
 

vbaInet

AWF VIP
Local time
Today, 23:14
Joined
Jan 22, 2010
Messages
26,374
Just adding to this in respect to the Vector question in Java. If you wanted a flexible ArrayList collection, like you have in Java being the Vector collection then then the two-dimensional associative array-like collection called a Dictionary object would suffice as lagbolt mentioned. The problem with using the Dictionary object is that because of its associative characteristics the keys (which is the first column in the array) must be unique. One good thing though, the Dictionary object can hold User-defined types as the ListIterator of a Vector collection can. Performance wise, they can probably compete.

With all that said, the main advantage of the Vector is its scalability, there's no such array collection in VBA (that meets your needs) that can manage its size without it being programmed to expand or shrink. So the only collection is the usual array and of course redim preserve is a costly operation.
 

Users who are viewing this thread

Top Bottom