Pat Tum

Pat Tum

  • NA
  • 16
  • 0

C# Query Issue: MSSQL vs Access

May 1 2008 1:18 AM
I recently wrote an application and used MSSQL as the backend.  After successful completion, I added an Access .mdb file to the app so that I could make it portable.  I changed the code appropriately from SQL Command to OLEDB Command, but it does not work.  This is the rub: I do not get an error and it will not return results when it is run from inside the program, however, when I copy the command line that fails and paste it directly into the Access Database query tool and run it, it returns a perfect result.  I am baffled!  I have the feeling that there is a syntax difference between the MSSQL and Access, but I cannot discover it, nor would that explain why it works correctly when it is pasted into the program directly.  Following is the SQL that comes directly from the program:

"SELECT DISTINCT T.Trans_Name AS Transmission,  M.Manufacturer, M.Concern, M.Years, M.Description, M.ATB " +
                 " FROM Master AS M INNER JOIN Trans AS T ON M.Trans = T.Trans  WHERE M.Manufacturer = @Manufacturer "

Any insight would be greatly appreciated.

Pat

Answers (2)