Run-time error 5

pts.
Tags:
Visual Basic
Hi, i have a problem. i made a .exe file of my project. when i search an Existing record its working fine. but when i enter a worng entery in search field the error Occurred "Run-time error 5 invalid procedure call or argument" but when i do all these exercise in vb 6 software it working fine no error Occurre. please help me in this regard as soon as Possible.

Answer Wiki

Thanks. We'll let you know when a new response is added.

qasimkhans,

Try setting the Error Trapping to “Break on All Errors” on the General tab of the Options dialog (Tools -> Options -> General tab). This will cause the IDE to break when you get the error, whether it’s handled or not. This should get you to the point where you can debug the problem.

Hope this helps.

Charles

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Qasimkhans
    i did but i have the same problem. kindly look into this. thankx.
    0 pointsBadges:
    report
  • Brandonbates
    If it's very repeatable, that's when I start sprinkling msgboxes around. Start putting in msgboxes starting at the beginning of the event that fires after whatever you are doing. then start working your way down until you don't get a message box and narrow it down to that line. If you already know the line, look carefully at the parameters and see what possibilities there are for an invalid argument.
    0 pointsBadges:
    report
  • BeerMaker
    The problem goes something like this: you are calling a procedure with a parameter that is bad or cannot be converted to the correct type (int, date, etc). VB will convert the type for you in most cases, however when it cannot convert the data, it will generate a runtime error. if your function takes a number and you are passing a string that can be converted to a number it works fine however if Myfunction below takes a number and you pass something like this it generates a runtime error. function myFunction(a_Value as int) call MyFunction("12345" ) ' this works Call Myfunction("a2345") ' this generates a runtime error The solution is to create an error trap and catch the error or perform validation on the parameter before you call the function call. For example: if isNumeric(myInput) then call MyFunction(myinput) else 'error message, etc end if
    0 pointsBadges:
    report
  • KajBre
    Sounds like there is a function used in the progran, which gets it's arameters in a wrong way like - wrong data type - some value missing (null) Try to run your program in VB6 development window, so you will be able to debug your program. Kaj Bredenberg
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following