php 与系统间 CACHE 的连接
我正在开发一个网站,我想在其中使用系统间缓存作为数据库。 我使用 DSN 与 Cache 连接,但显示以下错误:
警告:odbc_connect() [function.odbc-connect]:SQL 错误:[Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序,D:\wamp\www 中 SQLConnect 中的 SQL 状态 IM002 \CACHEPHP.php 第 12 行
这是什么意思,我能做些什么来解决它?
I am developing a website in which I would like to use Intersystems Cache for the database.
I use DSN to connect with Cache, but it shows this error:
Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in D:\wamp\www\CACHEPHP.php on line 12
What does this mean, and what can I do to fix it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要下载任何额外的东西。缓存附带了必要的 ODBC 驱动程序。
如果没有看到代码或如何设置 DSN,很难说,但我的猜测是您在如何配置 DSN 方面遇到了问题。错误消息表明甚至没有找到它。
我真正能建议的就是查看文档。标题为“通过 ODBC 使用缓存”的文章可能是最好的起点。这将引导您完成设置 DSN 的过程。
如果您遇到问题的 Cache 实例在单独的服务器上运行,您可能需要后退几步并针对本地安装的 Cache 进行尝试。您可以从 Intersystems 网站下载免费的单用户许可证。一旦您开始工作,针对基于服务器的实例进行调整应该不会太难。
另外,并不是说 PHP 有任何问题,但如果您的网站要大量使用基于缓存的数据,您可能需要研究一下 Intersystems 的 Zen 产品,它附带了 Cache。 Zen 可以让您直接从缓存中提供网页服务,从而无需单独的层。
You shouldn't need to download anything extra. Cache ships with the necessary ODBC drivers.
Without seeing code or how you set up your DSN it's hard to say, but my guess would be that you've got a problem with how the DSN is configured. The error message is saying it wasn't even found.
All I can really suggest is to check out the documentation. The article titled "Using Cache with ODBC" is probably the best place to start. That will walk you through the process of setting up your DSN.
If the instance of Cache you're having problems with runs on a separate server, you might want to take a couple of steps back and try it against a local installation of Cache. You can download a free single-user license from the Intersystems website. Once you get that working it shouldn't be too hard to adjust for your server-based instance.
Also, not to suggest there's anything wrong with PHP, but if your web sites are going to make heavy use of Cache-based data you might want to look into Intersystems' Zen product, which ships with Cache. Zen would let you serve your web pages right out of Cache, eliminating the need for a separate tier.