简体   繁体   中英

classic asp access DB not working on windows server 2012

Hi I tried to migrate my application, classic asp and access db from windows 7 professional to windows server 2012.

For standard script without accessing access db, it's working fine. But I got error when the script use access db, by the following:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified /includes/public.asp, line 64

Here is my connection string

strConn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("../private/apps.MDB")

In application pool, I've set

.NET Framework Version = No Managed Code 
Enable32Bit Application = True 
ManagedPipelineMode = Classic

Could anyone help, in which area should i look into?

Appreciate for the help.

The "Microsoft Access Driver" is the desktop driver installed when Office Access or the Office Access Redistributable is installed, it is not intended for use in server-side applications . The current Access driver is also known as ACE (Access Connectivity Engine) and replaces the JET engine for single-user desktop applications only .

Instead, please use the JET 4.0 OLEDB or ODBC driver (ODBC is preferred). This driver is included in MDAC which comes with Windows Server out-of-the-box. The connection string template is this:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\somepath\myDb.mdb;

OR

Provider=Microsoft.Jet.ODBC.4.0;Data Source=c:\somepath\myDb.mdb;

Note that the JET 4.0 driver is only available in 32-bit mode (but you've already set your application-pool to 32-bit so this won't be an issue).

Note that JET is effectively obsolete at this point (its successor, ACE, is only intended for use in single-user desktop applications) as evidenced by its availability only in 32-bit versions. Server-side and multi-user applications should use SQL Server (SQL Server now supports "LocalDb"-mode which introduces a simpler working experience, similar to Access, and it's available in Express Edition). If you absolutely need something simple and low-resource I would suggest SQLite, however you will be responsible for using the SQLite API correctly in a multithreaded/concurrent environment like a webserver (including Classic ASP).

Update:

I'll revise my answer to warn that using LocalDb with ASP.NET, or server applications in general, is inadvisable - and of little point, actually - if you're using LocalDb then you already have SQL Server installed, and if you already have SQL Server installed then you might as well use it in "normal mode" rather than LocalDb mode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM