Re: VB application crashes



Guys,

Thanks for the advises.
I think I found out where things go wrong. I just don't know why.
When I load the form in Private Sub Form_Activate() I have the
following code:

Call ImageLoader
Call LoadPositions
Call LoadLanguages
Call LoadPeople
Call LoadOrgs
Call LoadEvents
Call LoadUnits
Call LoadDocs
Call LoadReports
Call LoadVehicles
Call LoadEducations
Call LoadResidences

These are functions that load data into Listviews, for example:

Private Function LoadPositions()

Dim rsjob As Recordset
Dim strJob As String
Dim itmX As ListItem

strJob = "SELECT Id, BJID, position_title AS position, employer,
hire_date AS [date hired] FROM Jobs " & _
"WHERE Jobs.BJID = " & theName & " ORDER BY Jobs.hire_date
DESC"

Set rsjob = dbfASIC.OpenRecordset(strJob)

If rsjob.RecordCount <> 0 Then
ListViewPositions.SmallIcons = Main.ImageList1(1)

ListViewPositions.ColumnHeaders.Add , , "Position", 3200
ListViewPositions.ColumnHeaders.Add , , "Employer", 3200
ListViewPositions.ColumnHeaders.Add , , "Date Hired", 1500

rsjob.MoveFirst
Do While rsjob.EOF = False
Set itmX = ListViewPositions.ListItems.Add(, ,
rsjob.Fields("position"), , "Pos")
itmX.Tag = "P" & rsjob.Fields("Id")
itmX.SubItems(1) = IIf(Len(rsjob.Fields("employer") <> 0),
rsjob.Fields("employer"), "")
itmX.SubItems(2) = IIf(Len(rsjob.Fields("[date hired]") <> 0),
rsjob.Fields("[date hired]"), "")
rsjob.MoveNext
Loop
End If
Set rsjob = Nothing

End Function

I used to use the same Public recordset rs all the time but I changed
that. No effect however. Why is the prog crashing on this code? Is it
too much for VB?

MArco

expvb schreef:

"Co" <vonclausowitz@xxxxxxxxx> wrote in message
news:1157564633.229869.298470@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi All,

I have created an VB application with a MDI form and a lot of
Childforms.
When I run the application in VB environment there are no problems but
when I compile it
into an executable and start the program there is one sort of form that
makes the application crash.

I get the error that:
An error occured and VB will be closed.

I tried to find where things go wrong but that's not possible.

Can anyone help me with some tips here...

Marco


- In VB6, in the project's properties, go to the Compile tab and select
"Create symbolic debug info". This will create a PDB file when you compile
your project.
- Save and Compile.
- Run the EXE from Windows Explorer.
- Go to VC++ 6.0|File|Close Workspace.
- Go to Build|Start Debug|Attach to process, and select your running EXE.
- Go to View|Debug Windows, and make sure that "Call Stack" window is
visible.
- Let it crash.
- The call stack shows you where the problem is. One of the lines will point
to your source code, when you double click on that, it will show you the
source code and points to the exact line that caused the error.
- If the program closed normally, or you want to try again, go to
Build|Execute <Your EXE file name>.
- There are some settings that you could change, if necessary, in
Project|Settings|Debug.

See also:

How to debug a native code Visual Basic Component in Visual C++
http://support.microsoft.com/kb/166275/EN-US/

How To Debug a Visual Basic Out-of-Process Server with Visual C++
http://support.microsoft.com/kb/200034/en-us

Make sure that you disable "Create symbolic debug info" before releasing
your software.

.



Relevant Pages

  • Re: Cant delete .avi file after playing in WMP
    ... > private sub Command1_Click ... I never use Windows Media Player myself but if it is an object that can be part of an array then you could place one copy on your Form at design time and give it an Index of zero in the properties window, so that it becomes WindowsMediaPlayer1, but never actually use that copy. ... Then you could use Load in your code to load another copy ) and use that loaded copy to play your file. ... Then when you have finished you use Unload to unload WindowsMediaPlayer1. ...
    (microsoft.public.vb.general.discussion)
  • SDL for ARM compiling under GCC/CYWIN
    ... I have a simple helloworld application written in C++ with SDL under Windows. ... I need to compile the same files and load the application on a development board with ARM4...is possible? ...
    (comp.sys.arm)
  • SDL for ARM compiling under GCC/CYWIN
    ... I have a simple helloworld application written in C++ with SDL under Windows. ... I need to compile the same files and load the application on a development board with ARM4...is possible? ...
    (comp.arch.embedded)
  • Re: VB help
    ... What it does is to load a - in D5 ... How will the cell be initialised, and what is valid and how what happens on ... > to compile this code or it not working ... > Private Sub Worksheet_Change ...
    (microsoft.public.excel.worksheet.functions)
  • BCB 6.0 LoadLibrary
    ... How do compile my program in Borland c++ on the Windows XP? ... use LoadLibrary and load the dynamic library. ...
    (alt.comp.lang.learn.c-cpp)