Results 1 to 6 of 6

Thread: Runtime Error 5

  1. #1

    Question Runtime Error 5

    I recently coded a program on VB 6.0 Build 6.0.8176, and its giving some sort of crazy error.

    While execution there are 2 reversing loops, sometimes the prog runs smooth without any error and then sometimes it errors out. I searched many places and everything lead to some sort of explaination that wasn't the case with this particular problem. MSDN says that its an error that is produced when the compiler doesnt know what kind of error it is. Even trapping the error isnt doing any good. Has anyone here ever had such experiences? If yes then please tell me how you solved if that thing ever got solved.

    Thanks.

  2. #2
    In And Above Man Black Cluster's Avatar
    Join Date
    Feb 2005
    Posts
    912
    I did not go through the same situation ..... But usually I use the statment "On Error Resume Next" to avoid any kind of unknown error, use this if you ended up with nothing .......

    Do you have any idea about error handling: Like Stepping through, Breakpoints and watch points ????????? Google for them if you don't have any idea ....

    If you want to examine each block of code for error .. use the breakpoints .. this will work sufficiently to point you at the source of error ...........
    \"The only truly secure system is one that is powered off, cast in a block of concrete and sealed in a lead-lined room with armed guards - and even then I have my doubts\".....Spaf
    Everytime I learn a new thing, I discover how ignorant I am.- ... Black Cluster

  3. #3
    Well i have used all those methods like "On Error Resume Next" and have tried to use the debugging methods like step through and breakpoints... The main problem of this error is that it doenst occur everytime. Its something to do with some sort of data that comes sometimes and then it errors out. I tried to filter the data but then again its accepting null values and also irregular ones and still working fine but this thing has only happened when the exe is running not from inside the V.B environment!! Since this Error 5 comes only i was hoping to take care of that error directly......
    Taking on the internet with an Iron Fist. www.critical-error.com

  4. #4
    In And Above Man Black Cluster's Avatar
    Join Date
    Feb 2005
    Posts
    912
    does the user enter some data to the program?? If yes, have you taken some actions to validate the inputs ..... I guess that the problem is somewhere in the user inputs ....

    Validation is really important to make the program robust ..... if you want I can help to validate the inputs .... just point me to the validation inputs ... and I will help ...

    Cheers
    \"The only truly secure system is one that is powered off, cast in a block of concrete and sealed in a lead-lined room with armed guards - and even then I have my doubts\".....Spaf
    Everytime I learn a new thing, I discover how ignorant I am.- ... Black Cluster

  5. #5
    Just Another Geek
    Join Date
    Jul 2002
    Location
    Rotterdam, Netherlands
    Posts
    3,401
    Validation yes! But not just the userinput. Check everything. You won't be the first that did a CreateObject and assumes the object to be created all the time. Check to make sure you actually created the object before using it.

    Can you post (parts of) your program? It'll make it a whole lot easier to find the flaw.
    Oliver's Law:
    Experience is something you don't get until just after you need it.

  6. #6
    As suggested im pasting a part of the code which executes nonstop untill the data inside the lists finish up. This is the part thats causing that Error 5. I have taken out all the error handling from this part so that everyone can use their own technique.


    Private Sub Command3_Click()
    State = True
    Dim cnt As Integer
    Dim a As Integer
    If lst.ListCount = 0 Then Exit Sub
    For cnt = 0 To lst.ListCount
    If cnt = lst.ListCount Then cnt = 0
    If State = False Then Exit Sub
    lst.NUM = lst.List(cnt)
    SendPack Prejoin(ID)
    Pause (10)
    Call Command1_Click
    Pause (5)
    If lstC.listCount = 0 Then Call Command1_Click
    For a = 0 To lstCs.ListCount
    SendPack PM(ID, lstC.List(a), Text3.Text)
    Pause (1)
    Next a
    lstC.Clear
    Logout (ID)
    Pause (10)
    Next cnt
    End Sub

    Here Command1_Click() calls a login function only and thats not really the cause of the problem as if the login isnt succesful it shows an error there and starts to relogin.

    Lets hope someone hits this thing up....
    Taking on the internet with an Iron Fist. www.critical-error.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •