I have a VB.net application that gets data off our server with ODBC and populates and saves a Word Document. When I try to deploy it to another computer it will get the data just fine and populate the first document, but it will crash before saving it. I've installed the .net framework 4.0, Microsoft Data Access Components, and the Microsoft ODBC .net data Provider. The error code is 0xC0000005, which is from what I can see is called an "Access Violation Exception."

It works fine on my computer.

Recommended Answers

All 3 Replies

Inability to save the the file to the specified location? Where is it trying to save the file to?
It also shows your code isn't production ready, saving files is something that should have error handling code for just this kind of exception.

It saves the file to the directory the executable is in. I've tried moving the project folder and installing from the Publish option as well. It's not production ready which is why I'm testing it. And knowing the exception thrown doesn't preclude having error handling on it, I usually have it display the exception with the error message box.

Nevermind found my mistake. The SaveAs2 function only works with MS Word 2010 (which is what I was using, but all of the other PCs have earlier releases installed).

Be a part of the DaniWeb community

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