Results 1 to 14 of 14

Thread: Problem On Different PC

  1. #1

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Problem On Different PC

    Hello,

    I have created a very simple VB application (if you can really call it that ), which simply takes a copy of a database and copies it to a specific location at a time I specify on the form.

    It works absolutely fine here when I create it, and I simply save it as an EXE to run on my home PC.

    When I try to run it at home however, I get a message saying something along the lines of : System Error &H80070583 (-2147023485) Class does not exist

    That said, if I open VB6 up at home, and run it from there, it seems to work fine.

    Can you please tell me how I can get round this ?

    Thanks.

    J.

  2. #2
    Addicted Member
    Join Date
    May 2004
    Location
    Nagpur, India
    Posts
    228

    Re: Problem On Different PC

    Are you distributing only the EXE?
    Which line is giving this error?

  3. #3

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: Problem On Different PC

    I can't find out which line is giving me the error as the program works in the debug version (i.e. In VB itself)

    The message comes up as soon as I click onto the EXE.

  4. #4
    Addicted Member
    Join Date
    May 2004
    Location
    Nagpur, India
    Posts
    228

    Re: Problem On Different PC

    OK, are you just creating the EXE and copying on the other PC?
    Plus have you added reference to any files in your VB project?

  5. #5
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Problem On Different PC

    Yes i think you are just creating an exe and distributing it.

    This will not work since VB requires a runtime file to be installed on the host machine. Try using the Package and Deployment wizard which should be in your VS folder. This will include all nessercery run times.

    Pino

  6. #6

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: Problem On Different PC

    Thanks for your very quick response.

    Yes I am just creating the EXE (I'll be honest, I know no other way to do it)

    There are no references apart from the standard ones (VB for applications, VB runtime, VB objects and procedures etc)

  7. #7
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Problem On Different PC

    Use the package and deployment wizard is the easiest to use, and will get the job done. Should be included with your VB install.

    Its under Microsoft Visual Basic 6.0 Tools > P&D wizard

    also more installers

    http://www.vbforums.com/showthread.php?t=315829

    Pino

  8. #8
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Problem On Different PC

    Download MZTools.
    Using it add line numbers to your code.
    Then in the beginning of every sub add,
    VB Code:
    1. On Error GoTo TrapErr
    Just before all End Sub add,
    VB Code:
    1. Exit Sub
    2.  
    3. TrapErr:
    4.        MsgBox Err.Description & vbCrLf & _
    5.           "in Form1.Command1_Click " & _
    6.           "at line " & Erl, vbCritical Or vbOKOnly, "ERROR !"

    Your code should look like this,
    VB Code:
    1. Private Sub Command1_Click()
    2.              
    3.        On Error GoTo TrapErr
    4.  
    5.        Dim strPath As String
    6.          
    7. 10     strPath = "C:\WINXP\System32"
    8.          
    9. 20     Text1.Text = Left(strPath, 3) 'Gets drive
    10. 30     Text2.Text = Right(strPath, Len(strPath) - 3)
    11.  
    12. Exit Sub
    13.  
    14. TrapErr:
    15.        MsgBox Err.Description & vbCrLf & _
    16.           "in Form1.Command1_Click " & _
    17.           "at line " & Erl, vbCritical Or vbOKOnly, "ERROR !"
    18.  
    19. End Sub

    Change Form1.Command1_Click with your ComponentName.ProcedureName if you like.

    Run compiled exe. When the error occours, a messagebox will be displayed with the line number. See that line in your code.

    I have seen thin problem before. But I don't remember how I solved it.
    Last edited by iPrank; Feb 10th, 2006 at 06:22 AM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  9. #9
    Addicted Member
    Join Date
    May 2004
    Location
    Nagpur, India
    Posts
    228

    Re: Problem On Different PC

    And dont forget to add error handing to your project.
    At least you will know the module name and the procedure which is causing this error.

    You can have line numbers added to your source code, so you can get the exact line which is causing such problems.
    See this:
    http://www.aivosto.com/vbtips/errorhandling.html

    There must be some free, demo addins and are very helpful

  10. #10
    Addicted Member
    Join Date
    May 2004
    Location
    Nagpur, India
    Posts
    228

    Re: Problem On Different PC

    The problem is something related to Windows XP is all that i remember

  11. #11
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Problem On Different PC

    iPrank, isnt the reason he will be getting the error because he hasnt created a install package?

  12. #12

    Thread Starter
    Hyperactive Member Jonny1409's Avatar
    Join Date
    Mar 2005
    Posts
    308

    Re: Problem On Different PC

    Thank you all very much - I'll check it out when I get home tonight.

    Cheers.

    J.

  13. #13
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Problem On Different PC

    Quote Originally Posted by Pino
    iPrank, isnt the reason he will be getting the error because he hasnt created a install package?
    Quote Originally Posted by Jonny1409
    It works absolutely fine here when I create it, and I simply save it as an EXE to run on my home PC.

    When I try to run it at home however, I get a message saying something along the lines of : System Error &H80070583 (-2147023485) Class does not exist

    That said, if I open VB6 up at home, and run it from there, it seems to work fine.
    I guess both here and his home has VB6 installed. And he is not using any extra dependencies.
    So I guess it is not installer problem.

    I have faced this problem in my development pc.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


  14. #14
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Problem On Different PC

    Just a minute,
    Jonny1409, did you recompiled your app at home and tested again ?

    It may be a service pack issue.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


Posting Permissions

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



Click Here to Expand Forum to Full Width