PDA

Click to See Complete Forum and Search --> : Problem On Different PC


Jonny1409
Feb 10th, 2006, 04:50 AM
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.

mayurvb
Feb 10th, 2006, 04:55 AM
Are you distributing only the EXE?
Which line is giving this error?

Jonny1409
Feb 10th, 2006, 05:03 AM
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.

mayurvb
Feb 10th, 2006, 05:08 AM
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?

Pino
Feb 10th, 2006, 05:11 AM
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

Jonny1409
Feb 10th, 2006, 05:11 AM
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)

Pino
Feb 10th, 2006, 05:14 AM
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

iPrank
Feb 10th, 2006, 05:19 AM
Download MZTools (www.mztools.com).
Using it add line numbers to your code.
Then in the beginning of every sub add,
On Error GoTo TrapErr
Just before all End Sub add,

Exit Sub

TrapErr:
MsgBox Err.Description & vbCrLf & _
"in Form1.Command1_Click " & _
"at line " & Erl, vbCritical Or vbOKOnly, "ERROR !"


Your code should look like this,

Private Sub Command1_Click()

On Error GoTo TrapErr

Dim strPath As String

10 strPath = "C:\WINXP\System32"

20 Text1.Text = Left(strPath, 3) 'Gets drive
30 Text2.Text = Right(strPath, Len(strPath) - 3)

Exit Sub

TrapErr:
MsgBox Err.Description & vbCrLf & _
"in Form1.Command1_Click " & _
"at line " & Erl, vbCritical Or vbOKOnly, "ERROR !"

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.

mayurvb
Feb 10th, 2006, 05:21 AM
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

mayurvb
Feb 10th, 2006, 05:22 AM
The problem is something related to Windows XP is all that i remember

Pino
Feb 10th, 2006, 05:23 AM
iPrank, isnt the reason he will be getting the error because he hasnt created a install package?

Jonny1409
Feb 10th, 2006, 05:26 AM
Thank you all very much - I'll check it out when I get home tonight.

Cheers.

J.

iPrank
Feb 10th, 2006, 05:29 AM
iPrank, isnt the reason he will be getting the error because he hasnt created a install package?


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.

iPrank
Feb 10th, 2006, 05:31 AM
Just a minute,
Jonny1409, did you recompiled your app at home and tested again ?

It may be a service pack issue.