I have a web application that links to Microsoft Access and opens one of five databases depending on which button is clicked.

I coded it on my machine in Visual Web Developer 2008 and it works exactly as expected when ran on my machine, but when I move the files to a laptop that I need to use to present the web application to the people that need to approve them it stops working. This laptop also has Visual Studio 2008 and I'm able to open and run the web app just fine, but I get the following error when any of the five buttons are clicked:

"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

A snippet of the VB code is below. The last line is where the error is thrown. The databases are all on internal network drives and I can open them manually on the laptop by navigating through the folders, so it's not that they aren't there or that they actually are corrupt. Any ideas?

Dim db As Access.Application

db = New Access.Application
db.OpenCurrentDatabase("Path As String Here")

Recommended Answers

All 3 Replies

You will spend a whole lot less memory by using the .NET built-in classes for dealing with database connectivity.
More to the point, the OleDb namespace.

Your method will in practice open up a virtual instance of Access.
The .NET method only open up a connection to the database file through a connectionstring.
The connectionstring can be changed depending on what button is pressed.

Thank you for your input, but the whole point of this website is to allow an employee to actually open Access and view the database. We have forms built in Access for them to use. This is a very small website that just allows them to select the product line they wish to use and then open up an instance of that database.

Then I'm sorry I couldn't be of any help. :)
I have no fresh, or good, ideas of how to solve this.

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.