MS SQL query causes vague error message?
-
I am converting an ASP script to a PHP script. The current script runs on an IIS 6.0 server running ASP.NET and PHP 4.4.8. The script connects to a database in the form of a .MDB file. I can successfully connect to the database using the PHP method odbc_connect, but I cannot execute the queries that the original script used. I get the following vague error message: SQL error: [Microsoft][ODBC Microsoft Access Driver] Unknown, SQL state 37000 in SQLExecDirect The query I'm trying to perform is something like the following: select name from table; I can, however, execute the more generic "SELECT * FROM table" query just fine (using odbc_exec). By getting the results of that query, I was able to verify that the table actually has a column called "name". So what's the problem?
-
Answer:
"Name" is a restricted word in Microsoft Access and SQL Server. Try changing your query to: SELECT [Name] FROM Table Note that restricted words should be enclosed in [] brackets. [EDIT] Try to install the latest release of the FastCGI Handler for IIS 6.0 http://forums.iis.net/1103.aspx
William B at Yahoo! Answers Visit the source
Related Q & A:
- How can I optimize this dynamic SQL query in oracle with PL/SQL?Best solution by docs.oracle.com
- How to convert sql query to Hibernate Criteria query?Best solution by Stack Overflow
- How to convert my SQL query to MS Access query?Best solution by Stack Overflow
- How to make only ONE Sql query?Best solution by Stack Overflow
- How to convert SQL query to LINQ query?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.