상세 컨텐츠

본문 제목

사내 공통 DB 서버 mssql , ADO 연결시 80004005에러코드 문제점(WIN NT계열아니면 많이 일어남)

프로그래밍 관련/DB SQL

by AlrepondTech 2011. 2. 9. 15:04

본문

반응형

 

 

 

 

=======================

=======================

=======================

 

 

 

 

 

 

일단 내생각은 권한 떄문에 접속할수가 없어서 생겨난 오류인게 많은 것 같다.

 
(\\아이피) <- 윈도우 폴더 공유 접속시 
 
암호랑 아이디를 치고(공유폴더 공유된것확인) 다시 DB접속을 시도하니 해결이 되었다.
 
NT계열은 한번 시도하면 자동으로 공유 접속이 이루어지기 떄문에 문제가 덜생기고
 
DB서버 자체에서 권한을 얻어 접속을 하던가 아니면 
 
MSSQL설정을 바꾸어주거나 서버윈도우 설정을 바꾸어 권한을 풀거나 주어야한다.
 
 
아래 비슷한 질/답 모음으로 더욱 확실한 방법을 유추해 보아야 겠다.
 
질문
웹프로그래밍 도중 아래와같은 에러 메세지가 뜨는데 혹시 저 메세지가 의미하는게 정확히(?) 아시는분 있어면 알려주신다면 정말로 감사하겠습니다.<br>Microsoft OLE DB Provider for ODBC Drivers error '80004005' <br><br>[Microsoft][ODBC Microsoft Access 드라이버] Microsoft Jet 데이터베이스 엔진에서 '(알 수 없음)' 파일을 열 수 없습니다. 이미 다른 사용자가 이 파일을 단독 사용 모드로 열었거나 데이터 보기 권한이 필요할 수도 있습니다. <br><br>/saving.asp, line 3<br>윈도우즈 2000(sp2)<br>mdac 버전 2.7<br>ms acsess<br>혹 빠진게 있어면 알려주세요..<br><br>답변주신다면 정말 그 은혠 잊지않을게요...<br><br><br><br>
 
--------------------------답변
 

하나는 화일을 찾을수 없을때...

이거야.. 말그대로.. 찾을수 없으므로.. 경로를 함 체크해봐야져....
ODBC설정에서. 정한 경로에 디비화일이 있는지 점검하는거랑..


또하나는 화일의 권한이 없을때....

여기권한은 엔튀에서 화일 권한을 주는것중에 혹시 admin한테만 권한을 
주었을경우인데.. ODBC나. 웹을 통한 접근의 경우 로그인 아이디와 상관없이 설정속에 들어있는 계정으로 접근하게 됩니다
그러니깐. 설정속에 들어있는 계정이 접근 가능하게 권한을 풀어줘야겠져..
또한 윗분의 말씀대로 화일을 이미 열려진경우 쓰기가 않돼기 때문에..
다른 프로그램에서 사용중인지 체크해봐야 합니다


또하나는 화일의 권한이 맞지 않을때....

허걱... 이건 윗경우랑 가튼경우군여... ㅠ.ㅠ
 
--------------------------------------------------
 
여러경우에 나는거라.... 좀.. 정확히 머가 잘못됬다고 

하기가 참 어렵군여....ㅠ.ㅠ

하나는 화일을 찾을수 없을때...

또하나는 화일의 권한이 없을때....

또하나는 화일의 권한이 맞지 않을때....

등등인데...

어떤경우인지잘 모르겠군여.....


참고로 엠에스디엔 정보 보내드릴께염...

INFO: Troubleshooting Guide for 80004005 and Other Error Messages 

--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Data Access Components versions 1.5, 2.0, 2.1, 2.5 
Microsoft Active Server Pages 
Microsoft Visual InterDev, version 1.0

--------------------------------------------------------------------------------


SUMMARY
This article presents details for common causes of the 0x80004005 error received by Microsoft Data Access Components (MDAC), including ActiveX Data Objects, OLE DB and the Remote Data Service (RDS). Several other error messages are discussed, including, 80040e21, 80040e14, and 80040e10. 



MORE INFORMATION
The 80004005 error message can be summarized as "I couldn't get at your data for some reason." This article contains a listing of the various 80004005 error messages, the most frequent causes of the error messages, and troubleshooting steps to resolve them. While this article assumes you are using ActiveX Data Objects (ADO) within an Active Server Pages (ASP) page (.asp), the causes and many of the troubleshooting steps are applicable to any environment where ODBC is used for data access. 

Error Message Listing
This section presents the text of each error message and the causes of each error. 
Error Message
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access 97 Driver] The Microsoft Jet database engine cannot open the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view its data. 
Cause
This error may occur if the account being used by Internet Information Server (IIS), (usually IUSR), does not have the correct Windows NT permissions for a file-based database or for the folder containing the file.


Check the permissions on the file and the folder. Make sure that you have the ability to create and/or destroy any temporary files. Temporary files are usually created in the same folder as the database, but the file may also be created in other folders such as /Winnt.


Use the Windows NT File Monitor to check for file access failures. Windows NT File Monitor is available from the following Web site: http://www.sysinternals.com. 


If you use a network path to the database (UNC or mapped drive), check the permissions on the share, the file, and the folder. 


Check to make sure that the file and the data source name (DSN) are not marked as Exclusive.


Simplify. Use a System DSN that uses a local drive letter. Move the database to the local drive if necessary to test.


The "other user" might be Visual InterDev. Close any Visual InterDev projects that contain a data connection to the database.


The error may be caused by a delegation issue. Check the authentication method (Basic versus NTLM) if any. If the connection string uses the Universal Naming Convention (UNC), try using Basic Authentication or an absolute path such as C:\Mydata\Data.mdb. This may happen even if the UNC points to a resource local to the IIS computer.


This error may also occur when accessing a local Microsoft Access database linked to a table where the table is in an Access database on a network server. In this situation, please refer to the following article in the Microsoft Knowledge Base for a workaround: 
Q189408 PRB: ASP Fails to Access Network Files Under IIS 4.0 



Error Message
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Microsoft Access 97 Driver] Couldn't use '(unknown)'; file already in use. 
Cause
The database cannot be locked correctly for multiple users. For more information, please refer to the following article in the Microsoft Knowledge Base: 
Q174943 PRB: 80004005 "Couldn't Use '(unknown)'; File Already in Use" 
Error Message
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. 
Cause
The most common cause is that the connection string a session variable initialized in the Global.asa and Global.asa not firing. You may check to see that the variable is being initialized correctly by adding the following code to the .asp page: 
<%= "'auth_user' is " & request.servervariables("auth_user")%>


<%= "'auth_type' is " & request.servervariables("auth_type")%>


<%= "connection string is " & session("your_connectionstring")%>





Another common cause is using too many spaces in your connection string: 
DSN = MyDSN; Database = Pubs; 
Try using this syntax instead: 
DSN=MyDSN;Database=Pubs; 
If the Global.asa file is not firing, check to make sure it is in an Application Root for IIS 4.0, or a Virtual Root with the "Execute" check box selected if running under IIS 3.0. Also, a bug may prevent the Global.asa file from being fired when Windows NT permissions have restricted access to the folder, detailed in the Microsoft Knowledge Base article Q173742 "BUG: Global.asa Not Executed If Restricting Web Access" 


The DSN name is not found. Check to make sure a "User" type DSN is not being used.


If using a File or System DSN, try changing the connection string to "DSN=MySystemDSN" or "DBQ=MyFileDSN" as appropriate. Simplify!

Check to make sure that the most current drivers are installed. If in doubt, download the latest MDAC (Microsoft Data Access Components) from the following Web site: 
http://www.microsoft.com/data/



Error Message
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] Data source name not ?? 
Cause
This appears to be an issue with the order in which software is installed and uninstalled on the computer. If the ODBC core files become unsynchronized (they should all be the same version) you may see this error. 

Install the latest version of MDAC (Microsoft Data Access Components) from the following Web site to update all the core ODBC drivers: 
http://www.microsoft.com/data/
Error Message
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Access 97 ODBC driver Driver]General error Unable to open registry key 'DriverId'. 
Cause
This error is caused by reading a value from the registry. Check the permissions on the registry key using the registry editor, Regedt32.exe. You may also want to use the Windows NT Registry Monitor to check for registry read failures. NTRegMon may be downloaded from the following Web site: 
http://www.sysinternals.com
Error Message
Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC SQL Server Driver][dbnmpntw]ConnectionOpen (CreateFile()). 
Causes
There are two causes for this error. Both errors are permission-related issues and involve a database that is either on a different computer from the Web server, or the database is possibly being referenced using a UNC path (\Server\Share). Even if the database is on the same computer as the Web server, UNC paths make the database appear to the Web server to be on a different computer on the network. 
The following is true if the .asp page is accessed by an anonymous user: 

IIS will use (by default) a Windows NT account called: 
USR_. 
This account is local to the Web server and is essentially unknown to any other computers on the network. When IIS, oper

 

 

---------------------------------

 
 
액세스 디비는 다른 사용자가 이미 단독사용모드(읽기, 쓰기, 지우기)로 열었을 경우 동시에 다른 사용자가 디비를 액세스 할 경우에는 읽기 권한만을 주게 됩니다.

위의 경우는 단독사용모드 권한을 가진 사람이 디비 사용을 마친 후에 다음 사용자가 디비를 사용하면 해결되는 문제이구요.. 

또 다른 문제는 단독사용모드 사용자가 비정상적으로 종료했을때의 문제인데 이 경우에는 디비는 락(LOCK)이 걸려있고 이것이 풀리지 않을 상태입니다. 따라서 다음 사용자에게는 읽기 권한 밖에 가질 수가 없죠.. 

해결책은 다른 해결책이 있는지는 모르겠습니다만, 제 경우에는 디비의 내용을 txt형태로 저장하고 새로운 액세스 디비를 생성하고 자료를 옮겼습니다. 
 
----------------------------------
 
 
 

 

=======================

=======================

=======================

 

 

 
반응형


관련글 더보기

댓글 영역