2012-03-01 135 views
0

數據庫錯誤我有一個傳統的ASP應用程序,它連接到一個訪問數據庫,我收到以下錯誤,當我試圖訪問連接到數據庫的頁面:在傳統的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

如果您使用的是UID/PWD,則必須匹配用於鎖定數據庫的帳戶或者要寫入/鎖定數據庫權限的機器/域帳戶。另外,請記住,默認情況下,傳統ASP在IUSR_帳戶下運行 - 有時此帳戶必須具有對包含Access數據庫的目錄/文件的寫入權限。

+0

問題是,數據庫是在我的IIS的另一臺服務器上,並且IUSR_是本地帳戶不是嗎? – CallumVass 2012-03-01 13:20:57

+0

是 - IUSR位於機器本地。如果您正在訪問遠程訪問數據庫,那麼您的連接字符串需要反映該計算機上可用的帳戶。 – kpcrash 2012-03-01 13:25:52

+0

那麼,在我的例子中,這將是「管理員」?否則,我將如何在連接字符串中指定? – CallumVass 2012-03-01 13:28:19