日期:2014-05-18  浏览次数:20457 次

高分求解
OCIEnvNlsCreate   失败,返回代码为   -1,但错误消息文本不可用。  
说明:   执行当前   Web   请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。  

异常详细信息:   System.Exception:   OCIEnvNlsCreate   失败,返回代码为   -1,但错误消息文本不可用。

这个问题怎么解决?
刚接触oracle就碰到了这样让人摸不着头脑的问题.怎么办.

------解决方案--------------------
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=212065&SiteID=1
按这里的说法,这个应该是Windows XP and Windows 2003中,asp.net的工作进程(aspnet_isapi.dll ?)需要有读写oralce文件夹的权限。

Reference:

Just chiming in to confirm that this error is always a permissions problem, in my experience. I 've only seen it happen when permissions fail, or the managed provider fails to find a file it needs (not necessarily due to permissions, but some other installation problem).

If it can 't find *any* Oracle files, usually you will get a different error, the one that says you need to have Oracle 8.1.7 or higher installed. This error means it found enough to get started, but the OCI layer than failed to find a required file. This is probably because the initial OCI DLL is in a accessible location, but subsequent files are somewhere else.

FileMon (as already mentioned in this thread) and possibly RegMon can be good ways to track this down, particularly for permissions problems. You can get both tools at http://www.sysinternals.com.

Thanks,
Sarah