I made a VB project which saves and loads data by writing and reading from an MS Access database. One problem is when i run the exe on a different computer i get the "Runtime Error 91 Object variable or width block not set " error. Now I am assuming that is because I have not got MS Access installed on the computer (correct me if I am wrong). Are there any packages that can install all the required components onto a machine that hasnt got Access on it so it can work? Or is there another way I can get it to work?


Recommended Answers

All 5 Replies


Yes, I believe the error you are receiving is because the target machine does not have the necessary objects or components that is included in your application. You may need an installation tool, like InstallShield(if called this anymore) or Wise to distribute the appropriate components to the target machine.

If an installation tool is not readily available then you have to determine each component the application needs to run on the target and then register those components (.dll's) by running RegSvr32.exe, I believe.


Use the Package and Deployment wizard to create the Setup Package from the source system where u have developed this project.
This addin is a part of Microsoft Visual Basic.

1. Open ur project
2. Select Add-Ins -> Add-In Manager... option
3. Select the Package & Deployment Wizard
4. Put a check for Loaded/Unloaded and Load on Startup check boxes.
5. Click Ok.

Now u can find the Package & Deployment Wizard menu option in the Add-Ins menu. Click it and follow the instructions. This wizard will automatically identify all the required object, components and dlls for the project. except for user created files like ur database files, icon files etc. which if u want can manually add them in, i beleive 4/5 step of the wizard

Once the setup package folder is created, copy it to CD or pendrive and perform the setup process in the target computer.

Hope this helps u. Try it and if any problems get back to us.

Shaik Akthar

I have just told a collegue about your instructions Shaik Akthar, and for the project he is working on it works. I cant try mine right now but I am pretty sure it should work for me. Thanks a lot for your help, all this time I never new VB had its own packaging feature. I will keep you posted when I give it a go. Thanks a lot again

Any problems get back. If solved mark the thread as solved

Shaik Akthar

I am having a few other problems, not related. Thanks for your info, I think that part is now solved.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.