Infinite loops re-visited.

C

Chuckfonta

I have triggered an infinite loop problem by adding a new function to an
existing program. The problem appears that the system goes into 100% usage
and becomes non responsive. Looking at the dask manager access is running
99%.

The new function is a macro which does the following:
Opens a form to select a record in a table ( client list)
makes a copy of the selected record ( copy of the client record)
opens a form to edit the newly copy record
When the edit form is closed, the newly copied-edited record is added to the
client list.

This macro set seems to run correctly in a standalone mode but when it was
added to the application macros, it causes the appllication to go into an
infinite loop. as described above.

My quesstion is: Now what can I do to determine the cause and fix it?

My system has 1 gig physical memory, but the system seems to wan to run in
1/2 gig.
 
T

Tom Wickerath

Hi Chuck,

It would be helpful for you to post the code for your new function. Is there
a chance that you've forgotten to add a rs.MoveNext statement, where "rs" is
a variable representing a recordset?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
C

Chuckfonta

These functions are generated uisng the graphic interface, If it is worth
while I could try to capture each macro line as a screen image or what ever.
Or.... if there is an easier way to put together the visual basic I would be
glad to do it.

Im a newbe regarding visual basic, especially regarding my application which
is aproaching 45Kb of front end code.

BTW I am amazed at the quick responses posts to this blog are!!
 
C

Chuckfonta

After doing some cut and try again I have found that this qury causes the
system to go into an infinite loop trying to exit. It looks like all the
code executes, but when I try to close the application it never complets.

SELECT TourDescriptions_Tbl.TourDescrliptionID,
TourDescriptions_Tbl.Date_updated, TourDescriptions_Tbl.Agent_Edit_ID,
TourDescriptions_Tbl.TourName, TourDescriptions_Tbl.HandicapAcess,
TourDescriptions_Tbl.TourClassID, TourDescriptions_Tbl.[Available seats],
TourDescriptions_Tbl.Break_even, TourDescriptions_Tbl.TourOperator_ID,
TourDescriptions_Tbl.TourDescription,
TourDescriptions_Tbl.Destination_location,
TourDescriptions_Tbl.DestinationID, TourDescriptions_Tbl.DepartLocation,
TourDescriptions_Tbl.DepartDate, TourDescriptions_Tbl.DepartTime,
TourDescriptions_Tbl.ReturnDate, TourDescriptions_Tbl.ReturnTime,
TourDescriptions_Tbl.Transportation_vender_ID,
TourDescriptions_Tbl.TransportationID,
TourDescriptions_Tbl.TransportationCost,
TourDescriptions_Tbl.Transportation_payment_ID,
TourDescriptions_Tbl.Transportation_cancellation_deadline,
TourDescriptions_Tbl.Transportation_Reservation_deadline,
TourDescriptions_Tbl.Transportation_purchase_order,
TourDescriptions_Tbl.Transportation_Invoice,
TourDescriptions_Tbl.Transportation_order_date,
TourDescriptions_Tbl.Transportation_order_cancled,
TourDescriptions_Tbl.Transportaton_notes,
TourDescriptions_Tbl.Meal_vender_id,
TourDescriptions_Tbl.AvailableMealPlanID,
TourDescriptions_Tbl.MealPlanCost_pp, TourDescriptions_Tbl.Meal_order_date,
TourDescriptions_Tbl.Meal_cancelation_deadline,
TourDescriptions_Tbl.Meal_cancled, TourDescriptions_Tbl.Meal_Payment_ID,
TourDescriptions_Tbl.Meal_Purchase_order, TourDescriptions_Tbl.Meal_Invoice,
TourDescriptions_Tbl.Meal_Notes,
TourDescriptions_Tbl.Entertainment_vender_ID,
TourDescriptions_Tbl.Entertainment_ticketed,
TourDescriptions_Tbl.Entertainment_Tickets_ordered,
TourDescriptions_Tbl.Entertainment_Cost_pp,
TourDescriptions_Tbl.Entertainment_purchase_order,
TourDescriptions_Tbl.Entertainment_Invoice,
TourDescriptions_Tbl.Entertainment_payment_ID,
TourDescriptions_Tbl.[Entertainment_cancelation Date],
TourDescriptions_Tbl.Entertainment_order_date,
TourDescriptions_Tbl.Entertainment_notes,
TourDescriptions_Tbl.Second_Entertainment_vender_ID,
TourDescriptions_Tbl.Second_Entertainment_ticketed,
TourDescriptions_Tbl.Second_Entertainent_tickets_ordered,
TourDescriptions_Tbl.Second_Entertainment_Cost_pp,
TourDescriptions_Tbl.Second_Entertainment_Purchase_order,
TourDescriptions_Tbl.Second_Entertainment_Invoice,
TourDescriptions_Tbl.Second_Entertainment_order_date,
TourDescriptions_Tbl.Second_Entertainment_payment_ID,
TourDescriptions_Tbl.[Second_Entertainment_cancelation Date],
TourDescriptions_Tbl.Second_Entertainment_notes,
TourDescriptions_Tbl.Room_vender_ID,
TourDescriptions_Tbl.AvailableRoomPlanID, TourDescriptions_Tbl.SingleRate,
TourDescriptions_Tbl.DoubleRate, TourDescriptions_Tbl.TrippleRate,
TourDescriptions_Tbl.AdditionalPassenger,
TourDescriptions_Tbl.Room_Purchase_Order, TourDescriptions_Tbl.Room_Invoice,
TourDescriptions_Tbl.Room_Payment_ID,
TourDescriptions_Tbl.Room_Cancelation_Deadline,
TourDescriptions_Tbl.Room_Reservation_Deadline,
TourDescriptions_Tbl.Room_Commission, TourDescriptions_Tbl.Room_notes,
TourDescriptions_Tbl.Insurance, TourDescriptions_Tbl.Insurance_Cost_pp,
TourDescriptions_Tbl.Insurance_notes,
TourDescriptions_Tbl.Miscelaneous_expenses,
TourDescriptions_Tbl.Miscelaneous_expence_id,
TourDescriptions_Tbl.[Miscelaneous_Notes:],
TourDescriptions_Tbl.Client_Land_only_cost,
TourDescriptions_Tbl.Client_Package_cost,
TourDescriptions_Tbl.Frequent_Traveler_Discounts,
TourDescriptions_Tbl.Discount, TourDescriptions_Tbl.Tour_Cancelation_date,
TourDescriptions_Tbl.Deposit_Amount,
TourDescriptions_Tbl.Client_Final_Payment_Due,
TourDescriptions_Tbl.Client_Registration_Deadline,
TourDescriptions_Tbl.Client_Cancelation_Deadline,
TourDescriptions_Tbl.Client_Notes, TourDescriptions_Tbl.Escort_ID,
TourDescriptions_Tbl.Escort_Assistant_ID, TourDescriptions_Tbl.Escort_Notes,
TourDescriptions_Tbl.Tour_Descripton_Notes INTO copy_tour_descriptions_tbl
FROM Selected_tour_Description_ID_Tbl INNER JOIN TourDescriptions_Tbl ON
Selected_tour_Description_ID_Tbl.Selected_tour_ID =
TourDescriptions_Tbl.TourDescrliptionID;
 
T

Tom Wickerath

Hi Chuck,

That's a huge SELECT statement. If I counted correctly (?), you are
selecting 89 fields for appending into another table. I copied and pasted
your SQL statement into a new Word document, and it reports 4,074 characters
with spaces!

When there are this many fields, it usually always is an indicator of a
design that is not properly normalized. In general terms, most tables in
properly normalized databases do not tend to exceed about 25 fields (that's
not a hard and fast limit, just an approximation).

If you convert this APPEND query into a normal SELECT query (remove the part
that includes the INTO copy_tour_descriptions_tbl), does the query run okay
(and return its results in a reasonable amount of time)? If not, try removing
say 10 fields at a time until you narrow down which set of 10 fields last
removed causes it to speed up significantly. Then, continuing on this
iterative approach, try starting over with the original 89 fields, but now
remove one field at a time from the block of 10 fields that you identify a
possible bottleneck in.

How many records does this SELECT query return? Is there a network that
separates your PC from the .mdb file with the data (ie. is your database on a
file server, or is it a split database, with the back-end on a file server)?

I doubt it will help, but you can reduce the character count in this SQL
statement significantly by aliasing the table named "TourDescriptions_Tbl" as
"T". You can do a Find and Replace in MS Word to replace all occurances of
this table name with "T". Then, at the end, you need to provide the alias
like this:

....INNER JOIN TourDescriptions_Tbl AS T ON....

That'll cut the character count with spaces down to 2436 characters.

Here is a good link to learn more about Database Normalization:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101

Make sure to read the first two documents written by Michael Hernandez,
author of the book "Database Design for Mere Mortals" and co-author of "SQL
Queries for Mere Mortals".


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

Chuckfonta said:
After doing some cut and try again I have found that this qury causes the
system to go into an infinite loop trying to exit. It looks like all the
code executes, but when I try to close the application it never complets.

SELECT TourDescriptions_Tbl.TourDescrliptionID,
TourDescriptions_Tbl.Date_updated, TourDescriptions_Tbl.Agent_Edit_ID,
TourDescriptions_Tbl.TourName, TourDescriptions_Tbl.HandicapAcess,
TourDescriptions_Tbl.TourClassID, TourDescriptions_Tbl.[Available seats],
TourDescriptions_Tbl.Break_even, TourDescriptions_Tbl.TourOperator_ID,
TourDescriptions_Tbl.TourDescription,
TourDescriptions_Tbl.Destination_location,
TourDescriptions_Tbl.DestinationID, TourDescriptions_Tbl.DepartLocation,
TourDescriptions_Tbl.DepartDate, TourDescriptions_Tbl.DepartTime,
TourDescriptions_Tbl.ReturnDate, TourDescriptions_Tbl.ReturnTime,
TourDescriptions_Tbl.Transportation_vender_ID,
TourDescriptions_Tbl.TransportationID,
TourDescriptions_Tbl.TransportationCost,
TourDescriptions_Tbl.Transportation_payment_ID,
TourDescriptions_Tbl.Transportation_cancellation_deadline,
TourDescriptions_Tbl.Transportation_Reservation_deadline,
TourDescriptions_Tbl.Transportation_purchase_order,
TourDescriptions_Tbl.Transportation_Invoice,
TourDescriptions_Tbl.Transportation_order_date,
TourDescriptions_Tbl.Transportation_order_cancled,
TourDescriptions_Tbl.Transportaton_notes,
TourDescriptions_Tbl.Meal_vender_id,
TourDescriptions_Tbl.AvailableMealPlanID,
TourDescriptions_Tbl.MealPlanCost_pp, TourDescriptions_Tbl.Meal_order_date,
TourDescriptions_Tbl.Meal_cancelation_deadline,
TourDescriptions_Tbl.Meal_cancled, TourDescriptions_Tbl.Meal_Payment_ID,
TourDescriptions_Tbl.Meal_Purchase_order, TourDescriptions_Tbl.Meal_Invoice,
TourDescriptions_Tbl.Meal_Notes,
TourDescriptions_Tbl.Entertainment_vender_ID,
TourDescriptions_Tbl.Entertainment_ticketed,
TourDescriptions_Tbl.Entertainment_Tickets_ordered,
TourDescriptions_Tbl.Entertainment_Cost_pp,
TourDescriptions_Tbl.Entertainment_purchase_order,
TourDescriptions_Tbl.Entertainment_Invoice,
TourDescriptions_Tbl.Entertainment_payment_ID,
TourDescriptions_Tbl.[Entertainment_cancelation Date],
TourDescriptions_Tbl.Entertainment_order_date,
TourDescriptions_Tbl.Entertainment_notes,
TourDescriptions_Tbl.Second_Entertainment_vender_ID,
TourDescriptions_Tbl.Second_Entertainment_ticketed,
TourDescriptions_Tbl.Second_Entertainent_tickets_ordered,
TourDescriptions_Tbl.Second_Entertainment_Cost_pp,
TourDescriptions_Tbl.Second_Entertainment_Purchase_order,
TourDescriptions_Tbl.Second_Entertainment_Invoice,
TourDescriptions_Tbl.Second_Entertainment_order_date,
TourDescriptions_Tbl.Second_Entertainment_payment_ID,
TourDescriptions_Tbl.[Second_Entertainment_cancelation Date],
TourDescriptions_Tbl.Second_Entertainment_notes,
TourDescriptions_Tbl.Room_vender_ID,
TourDescriptions_Tbl.AvailableRoomPlanID, TourDescriptions_Tbl.SingleRate,
TourDescriptions_Tbl.DoubleRate, TourDescriptions_Tbl.TrippleRate,
TourDescriptions_Tbl.AdditionalPassenger,
TourDescriptions_Tbl.Room_Purchase_Order, TourDescriptions_Tbl.Room_Invoice,
TourDescriptions_Tbl.Room_Payment_ID,
TourDescriptions_Tbl.Room_Cancelation_Deadline,
TourDescriptions_Tbl.Room_Reservation_Deadline,
TourDescriptions_Tbl.Room_Commission, TourDescriptions_Tbl.Room_notes,
TourDescriptions_Tbl.Insurance, TourDescriptions_Tbl.Insurance_Cost_pp,
TourDescriptions_Tbl.Insurance_notes,
TourDescriptions_Tbl.Miscelaneous_expenses,
TourDescriptions_Tbl.Miscelaneous_expence_id,
TourDescriptions_Tbl.[Miscelaneous_Notes:],
TourDescriptions_Tbl.Client_Land_only_cost,
TourDescriptions_Tbl.Client_Package_cost,
TourDescriptions_Tbl.Frequent_Traveler_Discounts,
TourDescriptions_Tbl.Discount, TourDescriptions_Tbl.Tour_Cancelation_date,
TourDescriptions_Tbl.Deposit_Amount,
TourDescriptions_Tbl.Client_Final_Payment_Due,
TourDescriptions_Tbl.Client_Registration_Deadline,
TourDescriptions_Tbl.Client_Cancelation_Deadline,
TourDescriptions_Tbl.Client_Notes, TourDescriptions_Tbl.Escort_ID,
TourDescriptions_Tbl.Escort_Assistant_ID, TourDescriptions_Tbl.Escort_Notes,
TourDescriptions_Tbl.Tour_Descripton_Notes INTO copy_tour_descriptions_tbl
FROM Selected_tour_Description_ID_Tbl INNER JOIN TourDescriptions_Tbl ON
Selected_tour_Description_ID_Tbl.Selected_tour_ID =
TourDescriptions_Tbl.TourDescrliptionID;
 
C

Chuckfonta

Thank you for your advice. I have re-written the macro sequences, usiing
newly generated code, which by the way is created using Access's graphic
interface. ( Don't as yet write visual basic code) And here is more
information.

1. The process of creating the new table from the old one works. I can
see the new table in the navagation window, open and close it with out
problems.

2. If I don't run the this particular query as part of the copy change and
add sequence, Access behaves normally.

3. If I do run the copy, edit change sequence as part of a macro which is
intended to take an existing record, which is the description of a sight
seeing tour, it all runs correctly. However: I can not exit Access 2007.
The system goes to 100% use with the system taking between 40 and 60% of the
processor time, acording to the task manager.

I have not been able to view the Normalization references given, and I will,
when the network lets me.

A tutorial question: Is there a limit to the size of a record or the number
of fields contained in a data table? This table descries the detail of a
trip offered by a senior center travel department. I'm trying to keep data
entry as simple as possible, so I put all relivent information in one place.
Vender detail such as names etc... are identified by pull down lists and
uses table id key references.

I hope I have not stumbled upon a "Feature" in access which precludes
implementing the "copy, change, and save" feature I am trying to implement.

Thanks again for your advice and am looking forward to reading anyother
comments you may have.
--
Chuck Fontaine


Tom Wickerath said:
Hi Chuck,

That's a huge SELECT statement. If I counted correctly (?), you are
selecting 89 fields for appending into another table. I copied and pasted
your SQL statement into a new Word document, and it reports 4,074 characters
with spaces!

When there are this many fields, it usually always is an indicator of a
design that is not properly normalized. In general terms, most tables in
properly normalized databases do not tend to exceed about 25 fields (that's
not a hard and fast limit, just an approximation).

If you convert this APPEND query into a normal SELECT query (remove the part
that includes the INTO copy_tour_descriptions_tbl), does the query run okay
(and return its results in a reasonable amount of time)? If not, try removing
say 10 fields at a time until you narrow down which set of 10 fields last
removed causes it to speed up significantly. Then, continuing on this
iterative approach, try starting over with the original 89 fields, but now
remove one field at a time from the block of 10 fields that you identify a
possible bottleneck in.

How many records does this SELECT query return? Is there a network that
separates your PC from the .mdb file with the data (ie. is your database on a
file server, or is it a split database, with the back-end on a file server)?

I doubt it will help, but you can reduce the character count in this SQL
statement significantly by aliasing the table named "TourDescriptions_Tbl" as
"T". You can do a Find and Replace in MS Word to replace all occurances of
this table name with "T". Then, at the end, you need to provide the alias
like this:

....INNER JOIN TourDescriptions_Tbl AS T ON....

That'll cut the character count with spaces down to 2436 characters.

Here is a good link to learn more about Database Normalization:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html#DatabaseDesign101

Make sure to read the first two documents written by Michael Hernandez,
author of the book "Database Design for Mere Mortals" and co-author of "SQL
Queries for Mere Mortals".


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________

Chuckfonta said:
After doing some cut and try again I have found that this qury causes the
system to go into an infinite loop trying to exit. It looks like all the
code executes, but when I try to close the application it never complets.

SELECT TourDescriptions_Tbl.TourDescrliptionID,
TourDescriptions_Tbl.Date_updated, TourDescriptions_Tbl.Agent_Edit_ID,
TourDescriptions_Tbl.TourName, TourDescriptions_Tbl.HandicapAcess,
TourDescriptions_Tbl.TourClassID, TourDescriptions_Tbl.[Available seats],
TourDescriptions_Tbl.Break_even, TourDescriptions_Tbl.TourOperator_ID,
TourDescriptions_Tbl.TourDescription,
TourDescriptions_Tbl.Destination_location,
TourDescriptions_Tbl.DestinationID, TourDescriptions_Tbl.DepartLocation,
TourDescriptions_Tbl.DepartDate, TourDescriptions_Tbl.DepartTime,
TourDescriptions_Tbl.ReturnDate, TourDescriptions_Tbl.ReturnTime,
TourDescriptions_Tbl.Transportation_vender_ID,
TourDescriptions_Tbl.TransportationID,
TourDescriptions_Tbl.TransportationCost,
TourDescriptions_Tbl.Transportation_payment_ID,
TourDescriptions_Tbl.Transportation_cancellation_deadline,
TourDescriptions_Tbl.Transportation_Reservation_deadline,
TourDescriptions_Tbl.Transportation_purchase_order,
TourDescriptions_Tbl.Transportation_Invoice,
TourDescriptions_Tbl.Transportation_order_date,
TourDescriptions_Tbl.Transportation_order_cancled,
TourDescriptions_Tbl.Transportaton_notes,
TourDescriptions_Tbl.Meal_vender_id,
TourDescriptions_Tbl.AvailableMealPlanID,
TourDescriptions_Tbl.MealPlanCost_pp, TourDescriptions_Tbl.Meal_order_date,
TourDescriptions_Tbl.Meal_cancelation_deadline,
TourDescriptions_Tbl.Meal_cancled, TourDescriptions_Tbl.Meal_Payment_ID,
TourDescriptions_Tbl.Meal_Purchase_order, TourDescriptions_Tbl.Meal_Invoice,
TourDescriptions_Tbl.Meal_Notes,
TourDescriptions_Tbl.Entertainment_vender_ID,
TourDescriptions_Tbl.Entertainment_ticketed,
TourDescriptions_Tbl.Entertainment_Tickets_ordered,
TourDescriptions_Tbl.Entertainment_Cost_pp,
TourDescriptions_Tbl.Entertainment_purchase_order,
TourDescriptions_Tbl.Entertainment_Invoice,
TourDescriptions_Tbl.Entertainment_payment_ID,
TourDescriptions_Tbl.[Entertainment_cancelation Date],
TourDescriptions_Tbl.Entertainment_order_date,
TourDescriptions_Tbl.Entertainment_notes,
TourDescriptions_Tbl.Second_Entertainment_vender_ID,
TourDescriptions_Tbl.Second_Entertainment_ticketed,
TourDescriptions_Tbl.Second_Entertainent_tickets_ordered,
TourDescriptions_Tbl.Second_Entertainment_Cost_pp,
TourDescriptions_Tbl.Second_Entertainment_Purchase_order,
TourDescriptions_Tbl.Second_Entertainment_Invoice,
TourDescriptions_Tbl.Second_Entertainment_order_date,
TourDescriptions_Tbl.Second_Entertainment_payment_ID,
TourDescriptions_Tbl.[Second_Entertainment_cancelation Date],
TourDescriptions_Tbl.Second_Entertainment_notes,
TourDescriptions_Tbl.Room_vender_ID,
TourDescriptions_Tbl.AvailableRoomPlanID, TourDescriptions_Tbl.SingleRate,
TourDescriptions_Tbl.DoubleRate, TourDescriptions_Tbl.TrippleRate,
TourDescriptions_Tbl.AdditionalPassenger,
TourDescriptions_Tbl.Room_Purchase_Order, TourDescriptions_Tbl.Room_Invoice,
TourDescriptions_Tbl.Room_Payment_ID,
TourDescriptions_Tbl.Room_Cancelation_Deadline,
TourDescriptions_Tbl.Room_Reservation_Deadline,
TourDescriptions_Tbl.Room_Commission, TourDescriptions_Tbl.Room_notes,
TourDescriptions_Tbl.Insurance, TourDescriptions_Tbl.Insurance_Cost_pp,
TourDescriptions_Tbl.Insurance_notes,
TourDescriptions_Tbl.Miscelaneous_expenses,
TourDescriptions_Tbl.Miscelaneous_expence_id,
TourDescriptions_Tbl.[Miscelaneous_Notes:],
TourDescriptions_Tbl.Client_Land_only_cost,
TourDescriptions_Tbl.Client_Package_cost,
TourDescriptions_Tbl.Frequent_Traveler_Discounts,
TourDescriptions_Tbl.Discount, TourDescriptions_Tbl.Tour_Cancelation_date,
TourDescriptions_Tbl.Deposit_Amount,
TourDescriptions_Tbl.Client_Final_Payment_Due,
TourDescriptions_Tbl.Client_Registration_Deadline,
TourDescriptions_Tbl.Client_Cancelation_Deadline,
TourDescriptions_Tbl.Client_Notes, TourDescriptions_Tbl.Escort_ID,
TourDescriptions_Tbl.Escort_Assistant_ID, TourDescriptions_Tbl.Escort_Notes,
TourDescriptions_Tbl.Tour_Descripton_Notes INTO copy_tour_descriptions_tbl
FROM Selected_tour_Description_ID_Tbl INNER JOIN TourDescriptions_Tbl ON
Selected_tour_Description_ID_Tbl.Selected_tour_ID =
TourDescriptions_Tbl.TourDescrliptionID;
 
J

John W. Vinson

A tutorial question: Is there a limit to the size of a record or the number
of fields contained in a data table?

Yes to both: the total space actually occupied in a record cannot exceed 2000
bytes (it might be actually 2048 but there is some overhead), and it cannot
exceed 255 fields.

In practice 20 or 30 fields is a VERY wide table - "fields are expensive,
records are cheap". Proper normalized design involves getting rid of all
"repeating groups" of fields, by moving the data into multiple records of a
related table.
 
T

Tom Wickerath

Hi Chuck,

Can you answer some of the questions I asked yesterday? These include:

1.) If you convert this APPEND query into a normal SELECT query (remove the
part
that includes the INTO copy_tour_descriptions_tbl), does the query run okay
(and return its results in a reasonable amount of time)?

2.) How many records does this SELECT query return?

3.) Is there a network that separates your PC from the .mdb file with the
data (ie. is your database on a file server, or is it a split database, with
the back-end on a file server)?
A tutorial question: Is there a limit to the size of a record or the number
of fields contained in a data table?

John Vinson answered this question in his reply. However, I'll add that
Access MVP Allan Browne has a free utility available called the "Database
Issue Checker". This is a .mdb file itself. You can use it to test your
database (make sure your database is closed first). One of the checks it
provides is "Record too wide". So, if there is a possibility that the records
could exceed the 2000 characters, you will see this as a warning.

Database Issue Checker Utility
http://allenbrowne.com/AppIssueChecker.html


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
C

Chuckfonta

Hi Tom!

I have tested my system against your suggestions with the following results:

By changing the query to a simple select query, it runs and extracts all
fields.
If I put it back to a create table form it again runs correctly.

I then did the same with each of the other querys, and they too run correctly.

So now I grouped them into a macro which runs the queries and forms in order
and ran it. The processes run correctly, the record is copied, changed and
added back to the target data table. But when I go to exit access it hangs
in an infinite loop.

If I single step through the macro, each step executes correctly, and at the
end of the macro sequence, I am able to exit Access normaly!

My puzzle is this: why should single stepping make a difference?
I tried this application on a different computer, one running vista and
access 2007, and it runs properly.

To answer other questions, the application is split. The back end tables
are located on a shared disk file, while the front end is local. However in
this case, both the shared file and the local front end are on the same
physical computer, and for that matter the same physical disk. I don't know
if windows xp dummies up a network connection to the shared data, but in this
case everything is self contained.

I have not tried to re-combine the tables into one as yet.

I willl down load the data base issue checker and see what if anything it
finds.

BTW: I have run all the builtin Access - office diagnostics, which found no
problems.
I am running on a windiws xp which to the best of my knowledge is uptodate
as is my copy of access.

Sorry for the delay in getting back with the answers to your questions, But
I have had problems connecting.

Thanks again for your assistance

Chuck
 
T

Tom Wickerath

Hi Chuck,
My puzzle is this: why should single stepping make a difference?

I don't know. That sounds pretty strange. You might want to try converting
your macro to VBA code to see if that makes any difference. Are you
comfortable with the "how-to" to accomplish this?
I tried this application on a different computer, one running vista and
access 2007, and it runs properly.

I would try to locate a different PC that is running Windows XP with Access
2007, just to see if you can replicate this problem on another PC.
I am running on a windows xp which to the best of my knowledge is up to date
as is my copy of access.

Click on Start | Run and enter the command: winver
You should see that you have Service Pack 3 for Windows XP.

For Office 2007 (including Access 2007), you should have Service Pack 2,
which shows up as "SP2", when you click on the Office Button (upper left
corner), then Access options..., then Resources. The very last item in the
list shows the service pack information. For example, I see the following:

"Microsoft Office Access 2007 (12.0.6423.1000) SP2 MSO (12.0.6425.1000)"

It's the "SP2" in the above line that you should key in on.
I don't know if windows xp dummies up a network connection to the
shared data, but in this case everything is self contained.

If anything, I would think that Windows XP is more reliable compared to Vista!
I have not tried to re-combine the tables into one as yet.

Don't. If your application is already split, there's no point in bringing it
back together as one database. You have disabled Name Autocorrect in both the
FE and BE copies, right? If not, do so right away.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
C

Chuckfonta

Hi Tom

Being a programmer who started by pushing bits into registers, I remembered
an old trick we used to pull to make make up for computers slower than our
code. So I tried puttiong "NOPs" in my micro code. BINGO!

By putting a msgbox between each macro command, as yet I don't know which
one is key, the code runs successfully and now I can exit access normally.
Some where I remember that reading that access uses message boxes to
communicate between processes. Apparently one of the processes has not
completed before another takes over control. If this is so, stacks get
confused and can cause weerd results.

I suspect that we have been chasing a subtle bug in access. Or there is
some caviat about macros which I missed in my readings.

Thanks for all the help, I'm sure I would still be chasing this bug if not
for your help,
 
C

Chuckfonta

Hi again!!

My joy was short lived! Tampering with the content of the message boxes
broke it again!..... So thinking that the problem was the same just the work
around was wrong, Looking at the macro code again I noticed that the last
qury was opened but not closed. So I added a close to the sequence,
assuring that all the queries opened were closed. Tidy programming! and
again now it works.

The puzzle to me is: I have several macros with out all the close
statements and it appears that Access seems to be OK with it. I may have
uncovered a "FEATURE" of Access.

They say: insanity is doing the same thing over and over again expecting
different answers.
I say: Frustration is doing the same thing over and over again and getting
different answers.

Thanks again
Charlie
 
C

Chuckfonta

Hi Im Back!
Like the cat, that in the song keeps comming back, this bug seems to come
back each time I try to go to the next step. So far.... the only efective
way to stop the infinite loop at Access exit is to singel step throught the
macro process.

The "noop" soloution worked for a while. Then I noticed that one of the
message boxes had no text. So... I added a text to that box. OOPPSS the
Bingo was cancelled and the access hangs again at exit. Taking the message
out of that box did not fix it. (did not think of backups before the
change....oh well).

Then I tried the close at the end of the macro sequence, so that all quries
were closed before exiting the macro. In the standalone macro it seemed to
work, but when I integrated that macro call into the macros used by that
particular user screen, again it hangs up.

The stand alone macro call still works in single step but attempts to fix it
with close's fails full speed.

I am becomming convinced that either my operating system or my copy of
access is corrupted, or I have uncovered some weerd corner case which causes
Access to become confused.

BTW: I do not know how to convert the macro subroutiine into Visual basic,
can you point me to a "how to"? Also is there a code checker other than the
one you referenced, which by the way did point out some things which I fixed
to no avail.

Access is better than a vidio game, as each time you succeed at one level
the next one which pops up is more complex. But the reward for winning is
keeping your job.

Thanks again:
Chuck
 
T

Tom Wickerath

Hi Chuck,
Apparently one of the processes has not completed before another
takes over control.

I don't think this is true because, to the best of my knowledge, Access is
not a multi-threaded application. If you convert your macro to VBA code, you
can sprinkle in some DoEvents statements, which "Yields execution so that the
operating system can process other events" (copied directly from the Access
VBA Help).

Or there is some caviat about macros which I missed in my readings.

In Access 2003 and all prior versions, one cannot trap for errors and handle
them gracefully when using macros. Any errors that occur will cause a really
ugly macro error dialog to be presented to your users. The newest version of
Access, Access 2007 allows for error trapping, so macros are more appropriate
to consider using for Access applications created with Access 2007. However,
that said, macros in 2007 do not even begin to compare with the power
available when using VBA code.

<Begin Quote>

"Macros offer the next level down, extending the functionality of the GUI.
Macros are still limited, however, and do not provide anything like the
enormous flexibility of a programming language. Both the macro and the
programming languages take some effort to learn and, surprisingly, often
require relatively different skills; in other words, a good working knowledge
of macros may not make it much easier to convert to using the programming
language. Perhaps even more surprisingly, I do not believe that programming
is fundamentally more difficult to learn. Macros are easier to use but not by
orders of magnitude."

"If you are new to RDBMSs, I suggest (with as much deference as possible)
that you may well not be in a position to judge whether you need macros or
programming. In that case, my advice is clear. Unless you are sure that your
needs really are simple, don't bother learning to use macros. Once you find
that you need more than the GUI offers, go straight to the programming
language. In this way you avoid the pain of climbing one learning curve only
to discover that the view from the top is unsatisfactory and another climb
awaits you."

</End Quote>

From: "Inside Relational Databases, 2nd Edition, by Mark Whitehorn and Bill
Marklyn, published by Springer, p 151


From your other posts:
My joy was short lived! Tampering with the content of the message boxes
broke it again!..... So thinking that the problem was the same just the work
around was wrong, Looking at the macro code again I noticed that the last
query was opened but not closed.

You shouldn't need to close a query opened via a macro. In VBA code, if you
use the Set statement to set a variable to a QueryDef, then yes, you should
set the variable to Nothing as a part of cleaning up. But you shouldn't need
to close anything opened via a macro.

BTW: I do not know how to convert the macro subroutine into Visual basic,
can you point me to a "how to"?

Point your browser to here:
http://www.seattleaccess.org/downloads.htm

and then look for this download:
DAO - Back To Basics Compilation/Demo by Tom Wickerath, Jan/Feb 2007 --
Download (448 kb) App and Word Doc

The .zip file includes a Word document named "How to Convert Macros to
Visual Basic for Applications Code".

Also is there a code checker other than the one you referenced, which by
the way did point out some things which I fixed to no avail.

Sure. There's Total Access Analyzer, which I consider an excellent product.
http://www.fmsinc.com/products/analyzer/index.html
Access is better than a vidio game, as each time you succeed at one level
the next one which pops up is more complex. But the reward for winning is
keeping your job.

<Smile>


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
C

Chuckfonta

Hi Tom!

Thanks for the pointers and info, I'm off on my new quest, Visual Basic.
If/when I finally figure out what the root cause of my problem, I'll let you
know.
Thanks for your help!
Chuck.
 
D

David W. Fenton

to the best of my knowledge, Access is
not a multi-threaded application.

Access is a multi-threaded application.

But certain kinds of VBA processes execute synchronously and other
execute asynchronously. If you open a form, the code to setup the
form runs while the next line of code after the OpenForm statement
executes. That is, unless you open up the form as a dialog, in which
case execution pauses until the form is closed or hidden.

The point is: you don't have a lot of control over synchronous vs.
asynchronous execution in VBA code. But it's not because Access is
not multi-threaded, but because of the way VBA and Access execute
your code.
 
T

Tom Wickerath

Hi David,

Thank You for the clarification. Do you think that Chuck might be correct
with his macro that runs several (apparently) queries causing a problem
versus running it in single-step mode (no problem)?


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
__________________________________________
 
D

David W. Fenton

Do you think that Chuck might be correct
with his macro that runs several (apparently) queries causing a
problem versus running it in single-step mode (no problem)?

With macros, all bets are off. I wouldn't even try to troubleshoot a
problem with macros -- I'd convert them to VBA and work from there.

Macros are evil.

Don't use them.

And don't be surprised if they cause weird results because they have
never been a very robust way of getting things done.
 
C

Chuckfonta

Hi David!

Welcome to my world!

If access goes off and prefetches the next process thread for forms, does it
do this for queries too? If this is the case, then is there any way to
force a pause between these threads? I suspect by the tickelish nature of
this bug, some place in the main stream code is being corrupted. (I've
seeen this in some of my C coding bugs.)

The culprit seems to be a make table query which is trying to copy a very
large, maybe too large, table. Tom, your friend's filter program shows the
table to be too large if completely filled out. So I'm working on trimming it
down to size. Smaller assigned fields etc. But a major re-design would a
major effort and my bosses would be quite upset over the delay. So this
feature may go on indefinate hold.

Thank you all for all your help, and I'll keep you all advised of my progress.

Chuck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top