Program only works on my computer...Why?

I am just a newbie with vb7, but I just finished a program that acts as a front end to an Access database on the server. Used OleDbConnection, OleDbDataAdapters, Dataset bound to a Datagrid control as the output. 

The program works, I can even run the .exe from a floppy, but only on my own computer. If I carry the floppy to another computer on the same network, I get a "failed to initialize" error message. The Access database is on a directory available to everyone on the network.

I know there is some obvious thing I haven't taken into consideration. Go ahead, embarass me for my ignorance.

BC


Answer this question

Program only works on my computer...Why?

  • BrunoR2

    Application.ThreadException is an event that is thrown for unhandled exceptions. Add a handler in your code to catch the event.

    ThreadExceptionEventArgs.Exception will contain the exception. 

    Dump the stack to the screen so that you can see where in your code the error is occuring. I would think it is located in a com object and has to do with the system configuration. Yes, the framework does make use of some com objects. 

    C#
    public void OnThreadException(object sender, ThreadExceptionEventArgs t) 
    {
    MessageBox.Show(t.Exception.StackTrace);
    Application.Exit();
    }
         

    This is only for helping you debug the problem. I would not leave the code in for production. 

  • Dick Roose

    Does the machine that the program isn't working on have the .NET Framework installed
  • Kevin Kwan

    Thanks for the response, I got some results.

    I installed .NET framework (just the prerequisites from the vb7 discs) on another computer, now my program works in that computer. Am I going to have to install that on every computer that needs this application, or is there another way around this


  • LFDIII

    EVery .NET windows application requires the .NET Runtime to have been installed on the client computer, just as every windows application requires Windows to be installed. 

    Think of it this way: When DOS first came out, people have a choice between CPM and DOS (among others), and DOS applications required the DOS runtime in order to work. In the late 80s/early 90s, when Windows came out, you have to make sure your users had the Windows runtime installed in order to run Windows applications. 

    Now, we're there again. The required runtime environment is now the .NET Runtime, which is just another runtime for applications. It has to be installed in order for .NET applications to run. Of course, if you create ASP.NET applications, the runtime is only required on the Web server, not on each client machine.

  • Program only works on my computer...Why?