Link to home
Start Free TrialLog in
Avatar of Gary2397
Gary2397

asked on

Error when running application on XP OS

I have a vb6 application that I am attempting to run on a machine with the windows XP operating system. Currently, the application runs on a machine with w98 operating system. Originally , the application was installed on the machine with w98 using an installer program (I am new to vb6 and this application, so i assume this is the case).

NOW, to the Problem. The application can be accessed through a shared network drive. When the person attempts to access the appication and run the .exe in the application folder, using a different machine with XP operating sytem, there is an error:
Component Run Time Error 339
MSDATGRD.ocx or one of its dependecies not correctly registered: a file is missing or invalid.

Any help on resolving this?
ASKER CERTIFIED SOLUTION
Avatar of hes
hes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of J_K_M_A_N
J_K_M_A_N

Another way around it which isn't really recommended is to copy the MSDATGRD.ocx file to the local machines windows/system32 directory. I have done that in the past and it does usually work but like I said, not really recommended. You could also try to add the ocx file to the working directory on the server.

Good luck.

J_K_M_A_N
Avatar of Gary2397

ASKER

I understand what you are saying. This will load all of the dependecies, files, etc. needed to run the application. But, clarify something for me. Obviously, when installing the app on the xp machine, this will create an .exe where app can be run from this machine. Is there a way where the app can be directly executed from the network drive. This is what the user asked of me. Is this possible, or the best solution? I want to thank you, in advance, for your help.  
JKMAN - didn't see your post, until i had already posted my comment. This seems like something I may be interested in.
If i did install the MSDATGRD.ocx file on the local machine, in the system32 directory, I assume that the application would be able to find it, right?
Yes when you install it on the xp machine, point the install directory to a network share instead of the local harddrive.
As JK pointed out just you can copy that ocx in the system32 directory , but that might not be the only missing component, only the first one being reported.
if u wish to manually install that control u has to use regsvr32 command
for example in run window type as follow

regsvr32 <your OS drive char>:\<path to system32 folder>\msdatgrd.ocx

this will registers ur control and automatically ur applicatoin gets that from there.
It is recommended to register the ocx but I never do. :P It still finds it. (In my experience at least) And as 'hes' said, it may be the first of many that are missing. But usually you can copy them one at a time and keep a list so when you go to the next machine, just copy the whole list and don't overwrite.

Good luck.

J_K_M_A_N

Here is another option:

-  Create a "dummy" vb project; call it 'dummy', or 'controlsinstall', or whatever you like.  
-  Make a reference to all of the controls and references that you'll need for your main application(s).
-  Add a module, and in the sub main, don't write any code, if anything, just code 'end'.
-  Set the startup object to sub main.
-  Compile the .exe
-  Using vb's package and deployment wizard, build an installation package.

Now you have a package that can be installed on any pc that will properly deploy your controls and all dependencies for your main application.  Just install it to a pc, and now the exe's that are run from network share's will on that pc will find the runtime files needed.  Also, as you build more applications with new controls, just add controls/references as needed to your dummy project, re-create the package, then re-install to your user base.   You'll need to uninstall prior dummy.exe installs...but that doesn't take very long.

We did this at a previous job and it worked quite well.

Hope this helps!
Preece
>>It still finds it.
ActiveX components need to be registered as this is how they're "found". It'd only work without registering if it was initially registered and the file was deleted or the program itself registers it prior to using it.

.NET, however, provides registration-free COM interop as long as the file can be found (application/system folder, etc.).