Win7 ASP连接数据库“未找到提供程序.该程序可能未正确安装”问题
更新时间:2012年01月08日 18:42:18 作者:
今天调试了基于Access数据库的ASP应用,没想到IIS7报错,提示ADODB.Connection 错误 '800a0e7a' 未找到提供程序。该程序可能未正确安装
ASP连接数据库的连接字符串是Provider=Microsoft.Jet.OLEDB.4.0; Data Source=路径,采用的是OleDB方式连接,问题可能就出在OleDB方式连接这一环节上。
后来搜索网络得到了解决的办法 。原来是自己装的64位Windows 7系统的原因,默认64位环境下,IIS应用程序池未启用32位应用程序,我们只需要启用一下就可以了。打开IIS 7,定位到“应用程序池”,然后选择使用OleDB方式连接数据库的程序池,然后将启用32位应用程序设置为True就可以了。
Using MyODBC with ASP.NET in IIS7 on Vista x64
That's a heck of a title, but it's a problem I hit recently. I have a bunch of ASP.NET sites that use MySQL as their datastore, but I hadn't tried the on IIS7 yet. It took a while to get them to work at all (I had to set permissions on web.config and the other website files so that they could be read by both the Users group and the IIS_IUSRS group), but then I was left with an error about my MySQL connection. “ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified” – another very general error that basically means “Something is wrong with your ODBC driver, somewhere.”
After some searching, I learned two things. The first is that if you're running 64-bit you can't use the standard ODBC Data Source Administrator in Administrative Tools with MySQL. You've got to go to C:\Windows\SysWOW64\odbcad32.exe and set up your DSN, if that's your thing. The other thing is that the MyODBC driver is 32-bit only. So to use it at all, you need to make sure you're calling it from 32-bit apps only. That means you've got to tweak the Application Pool you're using to run all its ASP.NET applications as 32-bit. To do this, go to Administrative Tools > Internet Information Services (IIS) Manager (or just hit the Windows key and type “IIS”). Then go to “Application Pools” and select whichever application pool your ASP.NET app uses (or create a new one just for your MySQL apps. Click “Advanced Settings…” and set “Enable 32-Bit Applications”. Now the AppPool will use the 32-bit .NET CLR to run your app, and it'll be able to see your MyODBC driver (whether you use a DSN or not).
后来搜索网络得到了解决的办法 。原来是自己装的64位Windows 7系统的原因,默认64位环境下,IIS应用程序池未启用32位应用程序,我们只需要启用一下就可以了。打开IIS 7,定位到“应用程序池”,然后选择使用OleDB方式连接数据库的程序池,然后将启用32位应用程序设置为True就可以了。
Using MyODBC with ASP.NET in IIS7 on Vista x64
That's a heck of a title, but it's a problem I hit recently. I have a bunch of ASP.NET sites that use MySQL as their datastore, but I hadn't tried the on IIS7 yet. It took a while to get them to work at all (I had to set permissions on web.config and the other website files so that they could be read by both the Users group and the IIS_IUSRS group), but then I was left with an error about my MySQL connection. “ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified” – another very general error that basically means “Something is wrong with your ODBC driver, somewhere.”
After some searching, I learned two things. The first is that if you're running 64-bit you can't use the standard ODBC Data Source Administrator in Administrative Tools with MySQL. You've got to go to C:\Windows\SysWOW64\odbcad32.exe and set up your DSN, if that's your thing. The other thing is that the MyODBC driver is 32-bit only. So to use it at all, you need to make sure you're calling it from 32-bit apps only. That means you've got to tweak the Application Pool you're using to run all its ASP.NET applications as 32-bit. To do this, go to Administrative Tools > Internet Information Services (IIS) Manager (or just hit the Windows key and type “IIS”). Then go to “Application Pools” and select whichever application pool your ASP.NET app uses (or create a new one just for your MySQL apps. Click “Advanced Settings…” and set “Enable 32-Bit Applications”. Now the AppPool will use the 32-bit .NET CLR to run your app, and it'll be able to see your MyODBC driver (whether you use a DSN or not).
相关文章
Win7/Windows2003下IIS6.0、IIS7.5的伪静态组件安装和伪静态配置方法
Win7/Windows2003下IIS6.0、IIS7.5的伪静态组件安装和伪静态配置方法,还包括常用的伪静态规则使用方法2012-01-01cwrsync实现从linux到windows的数据同步备份
rsync是Linux系统下的数据镜像备份工具,从软件的命名上就可以看出来了——remote sync。rsync支持大多数的类Unix系统,无论是Linux、Solaris还是BSD上都经过了良好的测试。2008-09-09基于Win2008 R2的WSFC实现 SQL Server 2012高可用性组(AlwaysOn Group)
SQL Server 2012高可用性组在实现过程中较之早起的SQL Server故障转移群集来讲,不依赖特别提供共享存储磁盘阵列,每个节点独立存储一份数据库的副本2013-06-06Windows Server 2008 r2服务器无故自动重启故障的解决方法
Windows Server 2008服务器自动重启!登陆服务器之后,随便做什么操作,一两分钟服务器就自动重启,这里就给大家分享一下解决方法2020-02-02Windows Server 2008 R2 下配置TLS1.2添加自签名证书的图文教程
这篇文章主要介绍了Windows Server 2008 R2 下配置TLS1.2添加自签名证书的图文教程,非常不错,具有参考借鉴价值,需要的朋友参考下吧2016-12-12windows server 2008 R2 禁用ipv6和隧道适配器
这篇文章主要介绍了windows server 2008 R2 禁用ipv6和隧道适配器,需要的朋友可以参考下2015-09-09安装服务器常见组件之ISAPI_Rewrite组件图文安装教程
本教程共分八篇:系统安装与设置篇、软件安装与设置篇、文件及文件夹权限篇、系统服务篇、安全策略篇、系统组件篇、注册表篇、软件安全篇。本篇讨论的是第二篇软件安装与设置篇的第五部分:安装常见组件之ISAPI_Rewrite组件安装图解。2010-05-05
最新评论