?
Solved

Stack overflow in VB, how to prevent/control

Posted on 2001-07-14
3
Medium Priority
?
523 Views
Last Modified: 2008-02-20
I created a VB program which is in the process of development. The stage
I am in now, I simply acess a data base of 8000 stocks and transfer all
available price data which is available for whatever is in the data base
into indexed locations for (open, high, low, close, volume & date). I
transfer this for each stock and when I am still in the A stocks I get a
stack overflow.  I know what a stack is, but have no idea how to control
same (clear it out or change it's size with respect to VB use of same.
What should I do to control the size, prevent overflow.

Each time I go to access the new stock I cycle through various SUBs
which perform task like 'increment the index' and pass control back in a
loop which possibly produces a continuous series of the same stack
entries.  If I work to prevent these loops, will that solve my problem.
Doing so just makes me repeat the same code in many places and violates
my sense of good practice.   Thanks
0
Comment
Question by:WinniePough
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 15

Accepted Solution

by:
ameba earned 200 total points
ID: 6282609
Some stack error causes:
1. Reentering some procedure,
2. Usage of DoEvents,
3. Too big local variables (big string or array declared at procedure level)

For 1 and 2 check program logic; add flags to control 'states'.
For 3 - move your big array or string declaration to MODULE level.

If this doesn't help, post some code... e.g. procedure which gives stack error.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7086142
Hi WinniePough@devx,
You've requested to delete this question, but its status remains as 'Pending Delete' because one or more comments have been added.  Normally, the only way to fully delete such a Question is to post a message to Community Support and ask for assistance.

EE is making a one-time database sweep to purge the Pending Delete Questions automatically.  During this sweep:

    WinniePough@devx -- To allow the deletion to proceed:  Do nothing.
    EXPERTS -- Please DON'T POST a comment except to contest this deletion.

In the future, please refer to http://www.experts-exchange.com/jsp/cmtyHelpDesk.jsp#8 for instruction on deleting questions.

DanRollins -- EE database cleanup volunteer
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7105981
Finalized by Moondancer - EE Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses
Course of the Month14 days, 3 hours left to enroll

801 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