p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

access thread: making objects using codes


Message #1 by "Howard Stone" <ququmber@h...> on Mon, 3 Jun 2002 00:55:36
I am studying Access and the book I am using gives many examples of 
creating the following using code:

Tables
New columns
Index
Key
Forms
Reports
Controls

The book did not give real world examples of how this could be used and I 
lost as to the practicality of this.

Could someone comment on the necessity of these and give me specific areas 
where each of the above could use these in real world Access VBA 
programming.

Thanks
Message #2 by "Carnley, Dave" <dcarnley@a...> on Mon, 3 Jun 2002 09:58:05 -0500
Well, I once designed a system to run research projects. Each project used a
unique set of data files that had to be standardized and processed (survey
respondents names and demographics from different sources).  We gave the
project managers an interface that let them build their own data tables from
an existing domain of fields (names, address, city, race, gender, etc) even
making relationships between tables if needed.  So then our application
would create new tables to hold the data that was provided by the source.
The users could then map values from those source tables into standardized
survey questionnaires, and setup random selection rules (5 persons where age
>40, 5 persons of each gender, etc).  The application mapped those rules to
the database structures that were created by the user for that project and
generated the SQL needed to do the retrievals to print the surveys or later
analyze the results.  The application analyzed the rules entered by the user
to create indices on the project tables according to the rules that were
defined.  So that was one system where tables and indices were created at
run-time.

It was called QualPro, and it is the centerpiece of National Research Corp's
Dynamic Survey  www.nationalresearch.com/dynamic  my baby's all growed up!

HOWEVER it did not use Access at all, it was VB5 front-end and SQL7
back-end.  but the principle is there...

PS
all that stuff about legal expenses in NRCs quarterly report was from their
attempt to sue the consulting company I worked for to get out of paying the
$750,000 it cost to build that baby!  they lost...



-----Original Message-----
From: Howard Stone [mailto:ququmber@h...]
Sent: Sunday, June 02, 2002 7:56 PM
To: Access
Subject: [access] making objects using codes


I am studying Access and the book I am using gives many examples of 
creating the following using code:

Tables
New columns
Index
Key
Forms
Reports
Controls

The book did not give real world examples of how this could be used and I 
lost as to the practicality of this.

Could someone comment on the necessity of these and give me specific areas 
where each of the above could use these in real world Access VBA 
programming.

Thanks
Message #3 by "Randy Cornish" <rlcornish@c...> on Tue, 4 Jun 2002 00:22:50
I have used this functionality on two occasions:

  *  I supported an application that had a VB front end and an Access MDB 
backend.  When new versions were released, it often involved changes to 
data tables.  While "new" users always had an up-to-date template MDB, 
existing users had to have their schema altered (tables added, fields and 
indexes added to that table).  We did that in "conversion" code.

  *  Whenever you need to copy a table from one MDB to another, you can 
use TransferObject.  However, if one or both MDBs are password-protected, 
this method does not work.  I had to iterate thru DAO collections (table, 
field, indexes) and copy each table from one MDB to another, bit by bit.

I am more familiar with using the DAO Object Model to do this.  Helen 
Feddema is one expert on DAO I am aware of.  However, you can also use 
ADOX to make schema changes.

Having the ability to change the schema on the fly is powerful.  It 
lessens the need for "templates".  This is similar to the SQL features 
known collectively as DDL, only for Access/Jet databases.

R

> I am studying Access and the book I am using gives many examples of 
c> reating the following using code:

> Tables
N> ew columns
I> ndex
K> ey
F> orms
R> eports
C> ontrols

> The book did not give real world examples of how this could be used and 
I 
l> ost as to the practicality of this.

> Could someone comment on the necessity of these and give me specific 
areas 
w> here each of the above could use these in real world Access VBA 
p> rogramming.

> Thanks

  Return to Index