操作系统:windows 7 64bit visual studio版本:visual studio 2010 ultimate oracle版本:oracle 10g 10.2.0.1.0 新建web项目在连接oracle数据库时报错:ora-06413: connection not open. 网上搜索结果: 这个错误应该是由于oracle的一个bug造成的。 连接数
操作系统:windows 7 64bit
visual studio版本:visual studio 2010 ultimate
oracle版本:oracle 10g 10.2.0.1.0
新建web项目在连接oracle数据库时报错:ora-06413: connection not open.
网上搜索结果:
这个错误应该是由于oracle的一个bug造成的。
连接数据库的程序所在的路径是不允许有怪字符的。
2010在windows 2008 64位版本下安装时,默认有个program files ( x86 ) ,就是这个“()”引起的;
修改2010的安装目录,则在form程序中新建数据源,测试通过了;
但是新建web程序,手写连接数据库,运行,仍然提示“ora-06413: 连接未打开”;
原来在项目中运行web程序,默认是使用vs内置web服务器(develop server),而这个内置服务器的程序被安装在了c:/program files(x86)/common files/ 下面,这里也用到了(,因此造成了错误。
但是目前也没有找到在安装时能够修改这个内置server的安装路径的地方。
设置项目属性--web--servers--use local iis web serve
设置后保存重新运行程序,又出现新错误:
attempt to load oracle client libraries threw badimageformatexception. this problem will occur when running in 64 bit mode with the 32 bit oracle client components installed.
根据错误提示的内容大概是说这个错误是因为程序是以64位模式运行,而安装的oracle client是32位的。检查项目属性的build,都是anycpu。
解决办法:设置iis7程序池支持32位,这个步骤比较简单。但是如果你用的是iis6的话,就有点悲剧了,iis6改此设置比较麻烦。
再来运行一下,搞定。
