经典ASP应用程序中的数据库错

时间:2012-03-01 13:10:24

标签: asp-classic oledb

我有一个连接到访问数据库的经典ASP应用程序,当我尝试访问连接到数据库的页面时收到以下错误:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x1b48 Thread 0x1970 DBC 0x1948024 Jet'.

/gasket.inc, line 24

这是我的gasket.inc文件:

<%
'include file for gasket table database object


'Dimension variables
Dim adoConG         'Database Connection Variable
Dim strConG     'Holds the Database driver and the path and name of the database
Dim rsGasket        'Database Recordset Variable
Dim strAccessDBG    'Holds the Access Database Name
Dim strSQLG         'Database query sring


'Initialise the strAccessDB variable with the name of the Access Database
strAccessDBG = "\\MyServer\databases\gaskets\gaskets.mdb"

'Create a connection object
Set adoConG = Server.CreateObject("ADODB.Connection")

'Database connection info and driver
strConG = "DRIVER={Microsoft Access Driver (*.mdb)};uid=admin;pwd=; DBQ=" & strAccessDBG

'Set an active connection to the Connection object
'adoConG.Open "DSN=Gaskets"
adoConG.Open strConG

'Create a recordset object
Set rsGasket = Server.CreateObject("ADODB.Recordset")


%>

该管理员用户是否需要访问数据库的权限?还是我错过了一些显而易见的其他内容?

1 个答案:

答案 0 :(得分:1)

如果您正在使用UID / PWD,则必须匹配用于锁定数据库的帐户,或者具有对db的写入/锁定权限的计算机/域帐户。另外,请记住,默认情况下,经典ASP在IUSR_帐户下运行 - 有时此帐户必须具有对包含Access数据库的目录/文件的写访问权。