NeilZ wrote:
Just wondering ... why are you doing this when this function is already available in PC+ under the Mass Update Attendance module ?? This question from a someone who was (at one time) a IBM certified DB2 developer, and a 20 year programmer.
Incidently, I mentioned my experience only to point out that I wasn't a dangerous, over confident teenager. I didn't mean to sound like I was bragging. I'm just a very careful, thorough programmer type person.
Long story... Our pastor wanted to use a Welcome card approach similar to Rick Warren's Saddleback Church (See his book Purpose Driven Church). This card has name & address info on the front and check boxes for decisions made/info requested on the back. The cards were printed and passed out and information collected before any data people had a chance to think out what we'd do with them (hence the challenge of trying to borrow ideas without fully planning). These cards are filled out by EVERYONE, not just visitors EVERY week. Lots of data.
I wanted to try to use existing software as much as possible without writing a new "Welcome card system" from scratch. I decided (based on what I could tell from studying PowerChurch) to use the SKREF file to hold the codes for the check boxes and the ATDATA file to collect the card results because it could maintain the many to many relate between ME and SKREF with multiple hits on DATE. Some sample codes are:
skill_no desc
500 Sunday 10:30am Service
510 Wednesday 6:30pm Adult Service
511 Wednesday 6:30pm Youth Service
1000 Committing my life to Christ
1001 I want to be baptized
1002 Renewing commitment to Christ
1009 How to join this church family
1011 Adult Small group info
1012 Business/Professional Act info
1013 Single Activities info
1014 Single Parent Activities info
1015 Women's Activites info
1032 1st Time Guest
1033 2nd Time Guest
1040 Missions Info
1200 Pr: General
1201 Pr: Finances
1202 Pr: Marriage
1210 Pr: Family Issues
1211 Pr: Direction / Guidance
So for any given Sunday, a person can attend Sunday (500), request Singles info (1013) or request prayer for their marriage (1202). Obviously, 95% of the new data is a 500. The exceptions are keyed manually through normal screens. But keying the 200 attendance cards through normal screens takes a life time. I looked at the Membership / Attendance / Fast Data Entry but that doesn't seem to fit the bill. Did I miss something and re-invent the wheel? I must be able to specify EACH week who was there.
So I got the FoxPro ODBC driver and built a mini system in Access to speed it up. I dumped a query of the ME table into a work file and presented the list on screen. A column exists with a check box which when checked indicates "present". I then take all those with "present" and form 500-Sunday records for those persons on that date and append them to ATDATA. I love it when a plan comes together!
The Access SQL for the append is similar to this:
INSERT INTO atdata ( mail_no, pers_no, [date], skill_no, status )
SELECT 9 AS mail_no, 1 AS pers_no, #8/24/2004# AS [date], 500 AS skill_no, "P" AS status;
However, I'd like to be able to do other things like alternative screen presentation of the files for easier editing of some of the information but SQL update in Access doesn't work. I don't think it's a syntax issue because the Design View generated the code. For example, if I wanted to change an attendance status from "P" to "N" (and I never would really, but just to illustrate) in Access the statement would be like this:
UPDATE atdata SET atdata.status = "N"
WHERE (((atdata.mail_no)=9) AND ((atdata.pers_no)=1) AND ((atdata.date)=#8/1/2004#));
This bombs with "Operation must use an updateable table."
Similarly, if I wanted to delete the offending record, I'd use this:
DELETE atdata.*
FROM atdata
WHERE ((atdata.mail_no=9) AND (atdata.pers_no=1) AND (atdata.date=#8/24/2004#));
This bombs with "Could not delete from specified tables."
My ODBC connection is a User DSN named PowerChurchData doing a Free Table directory using MicroSoft Visual Foxpro Driver version 6.01.8629.01.
So, SELECTS and INSERTS work, but DELETES and UPDATES don't. The issue is WHY?
If you're still awake after all that, I'd appeciate hearing from you.
Thanks.
Andrew Turner