p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

access thread: OO Database Application


Message #1 by Omar Chaudry <OChaudry@b...> on Thu, 20 Jun 2002 09:59:16 +0100
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C21838.C1BFE890
Content-Type: text/plain

Hi All

 

I am currently planning a new application in Access but want to experiment
with Class modules as I understand the code is more portable this way. I'm
new to OO programming although I understand it in principle I would like
some pointers to possible uses of this in an Access application and whether
it is worth the effort. Any websites links, advise and recommendations would
be gratefully received.

 

Best regards

 

Omar

 



  DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee.  Access to this
message by anyone else is unauthorised.  If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful.  Please immediately contact the sender if you have received this
message in error. Thank you.



Message #2 by "Amy Wyatt" <amyw@c...> on Thu, 20 Jun 2002 14:32:08
I too have just started using the Class Modules (other than the object 
modules which are also class modules) and have found them very useful in 
certain respects. They seem to very fast.

To get started I used an Access Book that I have found very useful. It 
is "Access Developer's Handbook Vol. 1: Desktop Edition" by Getz, Litwin 
and Gilbert. It is not cheap but it has proved very valuable for me. I am 
sure there are all kinds of other books out there too. The nice thing 
about this one is it comes with a CD that has the code already written for 
some basic useful stuff that you can copy and use in your own applications.

Good luck,

Amy



Hi All

 

I am currently planning a new application in Access but want to experiment
with Class modules as I understand the code is more portable this way. I'm
new to OO programming although I understand it in principle I would like
some pointers to possible uses of this in an Access application and whether
it is worth the effort. Any websites links, advise and recommendations 
would
be gratefully received.

 

Best regards

 

Omar

 


Message #3 by "Carnley, Dave" <dcarnley@a...> on Thu, 20 Jun 2002 09:32:55 -0500
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C21867.5E18B1D0
Content-Type: text/plain;
	charset="iso-8859-1"

I wrote a long post about using classes to isolate database access, use the
search function on the message board it couldn;t have been more than a
couple of months ago.
 
I use a class to represent each database table, having properties for each
(most) fields, and standard methods get, save, new, delete. Internal flags
boolExisting and boolDirty track object state.
 
I use a class for each form in addition to the form's 'class', owning
objects and collections of objects based on database classes manipulated on
that form. (this is a littel different depending on if I am using Access or
VB6).  In VB6 I have the form's code responding to user events and handling
the most basic GUI validations - alpha/numeric formatting etc All processing
that involves actually changing data or validating against lookups etc is
done in a seperate "interface" class.
 
 
the interface form has a member object that holds a reference to the active
form it is controlling, so that in its methods it can use statements like
 
   if  frmCustomer.txtSSN = "" then
 
and it holds the actual database object
 
    private objCustomer as new clsCustomer
 
and does the actual manipulation when called from the form
 
    public SaveCustomer() as Boolean
        objCustomer.Name = frmCustomer.txtName
        etc...
        if objCustomer.Save() then
            SaveCustomer = True
        else
            SaveCustomer = False
        endif
    end sub
(of course this is over-simplified to just show the logic)
 
 
so the form code is kept very simple
 
{declarations in form_frmCustomer}
private Icustomer as new clsIcustomer
 
private form_load()
    Icustomer.ActiveForm = Me   
    {other form load code}
end sub
 
private cmdSave_Click ()
    boolSaved = Icustomer.SaveCustomer ()
    if not boolSaved then...
end sub
 
 
look up my other post if you want more detailed info on database isolation I
don;t have a copy
 

-----Original Message-----
From: Omar Chaudry [mailto:OChaudry@b...]
Sent: Thursday, June 20, 2002 3:59 AM
To: Access
Subject: [access] OO Database Application



Hi All

 

I am currently planning a new application in Access but want to experiment
with Class modules as I understand the code is more portable this way. I'm
new to OO programming although I understand it in principle I would like
some pointers to possible uses of this in an Access application and whether
it is worth the effort. Any websites links, advise and recommendations would
be gratefully received.

 

Best regards

 

Omar

 

--- Change your mail options at http://p2p.wrox.com/manager.asp or to
unsubscribe send a blank email to  



DISCLAIMER: The information in this message is confidential and may be
legally privileged. It is intended solely for the addressee. Access to this
message by anyone else is unauthorised. If you are not the intended
recipient, any disclosure, copying, or distribution of the message, or any
action or omission taken by you in reliance on it, is prohibited and may be
unlawful. Please immediately contact the sender if you have received this
message in error. Thank you.





  Return to Index