Solved

Data Controls causing crash

Posted on 1999-01-01
9
382 Views
Last Modified: 2008-02-20
I have a complex input form for my database front end in VB4.0.  I am using picture boxes and the tab control to place several input screens on one form using the various visible "true" or "false" settings.  One particular database table is causing all of the problems.  I have the field objects linked to a Data1 control for inputs.  I have a Button to make visible a DBGrid control linked to Data1. I can view the record table as input fields or as the data grid or datasheet by turning the visible true or false on or off.  When I use the "Refresh" button (Data1.Refresh) the program is crashing after one or two uses of "refresh" command.  This has been consistant.  I suspect that tying the Data1 control to the DBGrid and various field objects is causing the problem.  I either get an error "out of stack" or a crash message in Kernel32.Dll.  This message also shows "page fault" or "out of stack".  Does anyone have ideas on how to avoid this problem?
0
Comment
Question by:rallen070698
9 Comments
 
LVL 1

Expert Comment

by:agrillage
ID: 1453569
How much available memory on your computer?
0
 

Author Comment

by:rallen070698
ID: 1453570
Computer is a Pentium II with 64 MegRam and 6 GHD.  I noted in the documentation the "recursive" problem and also the limits on number of controls on a form.  I don't think this is the problem--could be wrong.  I put most of controls on as an array to cut the number down.  I do have a large number of GTMaskNum controls from Greentree on the form to handle fee inputs.  The program is a horse show data management program.  When I unlink the DBGrid control from the data1 control, I don't seem to be having the problem.  Also, in another program I haven't noted the problem either.  The "refresh" could be some how jamming between the DBGrid refreshing itself and the various field objects being refreshed when both are linked to the data control.  There are a number of fields in this particular table.

Bob Allen
0
 

Author Comment

by:rallen070698
ID: 1453571
For agrillage:  To visually explain the problem I start the application and bring up the Master Entry Form.  As this form is displayed it is in the "input" mode, ie., various fields are laid out on the form for entry.  A button is selected to show the DBGrid which is in a picture box control (visible property true or false).  Since the grid doesn't take up the whole form, you will still see various fields in the background.  I select the last of 128 records on the grid by using the RecordSelector.  The field object reflect the record change in accord with the grid selection.  I hit a Data1.Refresh button and the grid and input fields return to the first record.  I can do this a number of times with no problem.  However, if I used the last arrow on the Data control moving to the last record and then hit the Data1.Refresh the application will crash after two efforts to "refresh".  The system is so locked up most of the time that the error message box will not close and the computer has to be restarted.  The fault is in Kernel32.DLL as a page fault out of stack or memory..  
0
 
LVL 1

Expert Comment

by:agrillage
ID: 1453572
I asked about the memory because the stack is a memory store (if you know this already then excuse me). A page is a chunk of memory which windows wants to put on the stack. I cannot tell from your description that you are doing anything very bad. Have you had any problems with other applications? Is this a brand new computer? (in case the memory is bad).
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:rallen070698
ID: 1453573
Re the computer:  I have had it since March '98.  I have noted that in some applications or cases the processor bogs down and I have had to do a lot of Crt-Alt-Deletes to shut down certain tasks.  I took it back in twice with no apparent problem found.  It is an IBM Aptiva. How do I check for bad memory as its shows 64 megs of ram?  However, the problem described seems to happen only with this particular table.

Bob Allen
0
 
LVL 1

Accepted Solution

by:
wdavidsmith earned 200 total points
ID: 1453574
You say you're placing "several input screens on one form..." How many controls do you have on this form? The reason I ask is because I recently ran into a VERY similar problem. I was creating an entire database interface on a single form using a tab control. Eventually VB informed me that I could not place more than 255 controls on a form. Until I recieved this message, I was encountering compiler errors and out of memory errors, etc. I ultimately had to dismantle the entire application and place the controls onto separate forms. Luckily it didn't take too long (I just cut & pasted the controls, then the code). Something tells me that this is exactly what's happening in your situation.

I know this is probably NOT what you want to hear, but I hope this helps.

0
 

Author Comment

by:rallen070698
ID: 1453575
Reference the number of controls on the form, I am aware of the potential problem.  I placed most of the controls as an array which should make a difference.  I would note that I have a separate form for the one table causing the problem on the master entry form.  It does not have near the number of objects on the form, put both are producing the same "out of stack" problem when I use the data control to move the the last record and then "refresh".  It will refresh once and then crash.  So the essence of the application is to have a separate input form for each table, and then one master form that through the use of the Tab control can handle three other input screens by tabbing.  The others aren't causing the problem.


0
 

Author Comment

by:rallen070698
ID: 1453576
I am not sure the problem is totally related to the number of controls alone.  In the case of my problem I reduced the number of fields in the particular table which were currency fields and moved into a separate table.  However, I put those controls on a TAB control area with a different Data Control.  This appears to have solved the problem with this particular table.  Some how the data control when moved to the last record and refreshed is not handling the "refresh" properly.  So is the problem too many fields in the table?  Also, does the linking to the DBGrid in this context compound the problem.  I am now checking one other table with a large number of fields to ascertain if it will cause the same problem--it did crash yesterday...!  Re the number of controls, I understand that potential problem, but have not gotten any warnings from VB.  Finally, what version of VB are you using?
0
 

Expert Comment

by:Custard
ID: 3874636
If you are getting the same problem with True DB Grid 5.0 then ftp to www.apexsc.com and download "tdbg5u.exe" from their site.

This should update the true db grid control to version 5.0e.  It cuts the number of page faults the grid control generates by over 75%.

I doubt this is a memory problem as I have had the same error appear on numerous machines with memory ranging from 32Mb to 512Mb.

If you are using the VB4 version of the control then you may need to download a different file to the one mentioned above.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now