Re: Proper coding methods
Welcome to VBForums :wave:
You did pick the wrong place I'm afraid - deployment is about installing etc. So that I can move it to the correct place, which programming language (and version) are you using?
Note that using DAO is almost certainly a terrible idea, because it is seriously out of date. We have been told by Microsoft since 1998 (or maybe earlier) to not use it, and for several years it has been officially obsolete (which is much worse than "unsupported"), and is virtually guaranteed in certain situations (which are gradually becoming the norm).
Re: Proper coding methods
Hey thanks - I obviously didn't read the section name properly, I thought it said development!!! oops!
I'm using VB as the code-behind for ASP.NET web app, not sure exactly what version - but I think 3.5. Using VS2008 if that makes any difference also.
Just to clarify, I'm not using any built-in DAO modules but a custom class - It's basically just to seperate all my db operations away from other code/logic etc so pin-pointing issues is easier and less code duplication...
If this isn't the right way, can someone point me to a decent tutorial covering this - the only OOP tutorials I can ever find only cover what a class is and how to use it... not the more detailed/complex stuff like database connections etc...
NB, unfortunatly I'm also using MS Access for this one (uni project and they won't let us use anything else - probably to force us to code things ourselves!!)
Thanks again for your help
Re: Proper coding methods
You certainly aren't the first to make that mistake - thread moved to 'ASP.Net' forum
DAO was replaced by ADO before VB6 (aka VB 1998) was released, and VB.Net (VB 2002 and later) has a replacement for ADO too - which is ADO.net.
It isn't surprising that you can't find OOP database tutorials, as they are essentially two different and unrelated subjects - OOP is basically about how you arrange the code, rather than what the code does.
You can find a good ADO.Net Tutorial (and other things for DB related work) in our Database Development FAQs/Tutorials (at the top of the Database Development forum)
Re: Proper coding methods
Hey,
Thanks for moving the thread si!
What you are describing is definitely a "good" way to structure your code. i.e. separate layers for the appropriate actions. One of the best examples of this that I have seen is the original BeerHouse Sample kit, which you can see here:
http://thebeerhouse.codeplex.com/releases/view/127
This has subsequently been updated to use .Net 3.5, and you can find this here:
http://thebeerhouse.codeplex.com/releases/view/33900
And also, to use MVC, but that is another kettle of fish :)
I have never looked at the 3.5 version, but I am sure it is of the same quality.
This project shows exactly how data can be retrieved from the database (in a database agnostic way), sent through a Business Logic Layer, and then ultimately displayed to the client.
Hope that helps!!
Gary
Re: Proper coding methods
hey guys,
thanks a lot for the replies - they are all helpful, something for me to go and work with :)
Thanks again.
Chris
Re: Proper coding methods
Yip, have a look, and then post back if you have any specific questions.
Gary