What causes this error? “Runtime error 380: Invalid property value”

前端 未结 13 1856
野的像风
野的像风 2020-12-18 00:21

we had developed an application using vb6.0 and SQL server 2000 a few years ago. recently, some of our customers tell us that while running the application, on some of comp

相关标签:
13条回答
  • 2020-12-18 00:53

    Many really silly things can cause this error. The one I've encountered is a font no longer included with Windows 8 by default - Courier New. The VB6 application had its name hard-coded in one of the forms, hence the message on start-up.

    0 讨论(0)
  • 2020-12-18 00:54

    2017 I know... but someone is facing this problem during their code maintenance.

    This error happened when I tried:

    maskedbox.Mask = "#.###"
    maskedbox.Text = "12345678"
    

    To fix that, just set PromptInclude property to "false".

    0 讨论(0)
  • 2020-12-18 00:58

    I had the same problem in masked edit box control that was used for Date and the error was due to Date format property in Region settings of windows. Changed "M/d/yyyy" to "dd/MM/yyyy" and everything worked out.

    0 讨论(0)
  • 2020-12-18 00:59

    Could be you are locating in the screen a control (label, frame, text..) out of the screen borders. If the position of some control depends of any variable, and that variable is not correctly defined at start, you may have this error message.

    May be you have different screen resolution in both computers. And that could be the reason.

    in order to find the program bug, put this line in all subs: on error resume next

    if this correct the problem, you must clear this line in every sub, one by one, and verifying if the problem returns. When the problem returns after removing this line in a concrete sub, you will know the subroutine that stores the bug. Search there and you will find it.

    Santos@etronorte.com

    0 讨论(0)
  • 2020-12-18 01:02

    What causes runtime error 380? Attempting to set a property of an object or control to a value that is not allowed. Look through the code that runs when your search form loads (Form_Load etc.) for any code that sets a property to something that depends on runtime values.

    My other advice is to add some error handling and some logging to track down the exact line that is causing the error.

    • Logging Sprinkle statements through the code that say "Got to X", "Got to Y", etc. Use these to find the exact location of the error. You can write to a text file or the event log or use OutputDebugString.
    • Error handling Here's how to get a stack trace for the error. Add an error handler to every routine that might be involved, like this code below. The essential free tool MZTools can do this automatically. You could also use Erl to report line numbers and find the exact line - MZTools can automatically put in line numbers for you.

    _

     On Error Goto Handler
       <routine contents>   
     Handler: 
       Err.Raise Err.Number, "(function_name)->" & Err.source, Err.Description 
    
    0 讨论(0)
  • 2020-12-18 01:03

    I presume your application uses a masked edit box? This is a relatively well known problem, documented by Microsoft here:

    http://support.microsoft.com/kb/177088

    The article refers to VB4 and 5, but I am pretty sure the same is true for VB6.

    EDIT

    On further research, I am finding references to this problem with other controls as well. Recompiling your application on Windows XP for users that are running XP will probably produce them a working version, though it's not an ideal solution...

    0 讨论(0)
提交回复
热议问题