日期:2014-05-18  浏览次数:20439 次

access 参数查询怎么写
请问下sqlserver的查询在access怎么写,如下:

SELECT           ProductID,   ProductName,   SupplierID,   CategoryID,   QuantityPerUnit,   UnitPrice,   UnitsInStock,   UnitsOnOrder,   ReorderLevel,   Discontinued,
(SELECT   CategoryName   FROM   Categories   WHERE   Categories.CategoryID   =   Products.CategoryID)   as   CategoryName,   (SELECT   CompanyName   FROM   Suppliers   WHERE   Suppliers.SupplierID   =   Products.SupplierID)   as   SupplierName
FROM   Products   WHERE   (CategoryID   =   @CategoryID)

------解决方案--------------------
把@CategoryID换成?号就可以了,其他的跟sql一样

附:我是在MSDN上看到MS这么写的,自己没试过