I am developing a website in which I would like to开发者_StackOverflow 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?
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.
精彩评论