0

I have an old website that is built with classic asp and MS access 2000 and was running fine on an old server. I need it to work on new machine equipped with Windows Server 2008 R2 64bit & IIS7.5

I tested ASP classic and it is running fine on the new machine. What I am trying to do is to make connections with the ms access db.

I installed "Microsoft Access Database Engine 2010 Redistributable" 64bit and restarted the machine.

ASP code is something like this:

<%dim db
set db=server.createobject("adodb.connection")
db.open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("Staff.mdb")%>

I got the error message: "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed."

Is there some kind of configuration I need to do on IIS or something...

almoujtahed
  • 163
  • 11
  • 4
    *"I installed "Microsoft Access Database Engine 2010 Redistributable" 64bit"* - Okay , then if you want to use it your driver string needs to be `Driver={Microsoft Access Driver (*.mdb, *.accdb)}`. And remember: You shouldn't be using an Access database as the back-end of a web application. – Gord Thompson Oct 11 '15 at 18:28
  • 1
    Also, I do believe, if you use the search facility, you will find many questions on this subject on S.O. – Paul Oct 12 '15 at 07:45
  • Thank you @GordThompson adding *.accdb solve the problem !!! – almoujtahed Oct 12 '15 at 14:26
  • @Paul no such question similar to this specific issue... anyway try it your self, if you find any... post it here rather than sharing your wisdom – almoujtahed Oct 12 '15 at 14:28
  • [This thread](http://stackoverflow.com/questions/9595627/connecting-to-an-access-database-in-classic-asp-using-an-adodb-object/9595869#9595869) has a similar issue. [This thread](http://stackoverflow.com/questions/17086259/connecting-to-ms-access-database-within-asp-an-architecture-mismatch?rq=1) gives other clues. [This one](http://stackoverflow.com/questions/24416688/architecture-mismatch-between-32-bit-and-64-bit-odbc-drivers?rq=1) may also help. More?... – Paul Oct 13 '15 at 08:07
  • Also, using Bing, I found this which may be useful: [Using Classic ASP with Microsoft Access Databases on IIS](http://www.iis.net/learn/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iis), – Paul Oct 13 '15 at 09:24

2 Answers2

2

Driver={Microsoft Access Driver (*.mdb)} is the ODBC driver name for the older "Jet" database engine. It ships with Windows, but it is only available to 32-bit applications and it only works with the older .mdb database file format.

If you need to

  • work with an .mdb database from a 64-bit application, or
  • work with an .accdb database from any application

then you need to have the newer Access Database Engine (a.k.a "ACE") installed, and your driver name needs to be Driver={Microsoft Access Driver (*.mdb, *.accdb)}.

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
  • I did installed ACE and changed driver name to: Driver={Microsoft Access Driver (*.mdb, *.accdb)} and database format is .mdb. Now, I can read tables via classic asp but I can not do any modification (update/insert/delete). IIS user account got fill privileges on both database file and folder. I converted the database format to .accdb, still the same issue!! – almoujtahed Oct 14 '15 at 16:00
0

I used to have to migrate a web system that is asp connected to the mdb database worked on windows server 2003 moved to work on windows server 2008 R2.

encountered the same problem and fix it this way

1.The default setting after the IIS installation is complete will cause the error time to run. The details of the problem will not be displayed on the web browser. Solve the problem by : set IIS to show errors

(credit : https://learn.microsoft.com/th-th/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-default)

2.The problem encountered is that the database or object is read only. Solve the problem by :

  • Move the mdb file out of the web folder and not in the web subfolder. (ex : d:\web_data)

  • At the new folder of mdb, configure full control access to the users group of windows.

  • Specify a channel between asp and mdb with this command.

    Set Conn = Server.Createobject("ADODB.Connection")

    Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=d:\web_data\data.mdb"

(credit : https://learn.microsoft.com/th-th/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iis)

(credit : https://www.thaicreate.com/asp/asp-ms-access-connect-database.html)

hope this is helpful. :-)