MSACCESS 97使用旧系统中的vb.net进行查询

时间:2014-03-28 13:20:56

标签: sql .net vb.net ms-access

当我从.net运行以下查询时,会出现efail错误 enter image description here

但是,当我运行sql脚本时,它是成功的,这是一个遗留系统,我支持它在线说它是保留字,但我不能在这个查询中看到任何大小和所有都是前缀?

SELECT 
    Orders.OrderNumber, 
    Orders.OrderLine, 
    Orders.Orderdate, 
    Orders.Deldate, 
    Orders.CutOffDate, 
    detail.Location, 
    Location.Description,   
    TagBarCode.TagBcode, 
    detail.PLU, 
    Style.Description, 
    StockType.Description,
    VatRate.Vcode, 
    VatRate.Vatname, 
    VatRate.VatRate, 
    Orders.OnOrder, 
    Sum(Orders.Cost*Orders.Onorder) AS LineNetCost, 
    Orders.Cost, 
    Sum(orders.cost*(1+(VatRate.VatRate/100))) as GrossCost
FROM (
 (
  (
    (
      (Style INNER JOIN detail ON Style.uniqueref = detail.UniqueRef)
      INNER JOIN Orders ON (Orders.PLU = detail.RootPlu) 
                       AND (Style.uniqueref = Orders.UniqueRef) 
                       AND (detail.Size = Orders.Size) 
                       AND (detail.Location = Orders.Location)
    ) 
    INNER JOIN StockType ON detail.Stocktype = StockType.Stocktype
   ) 
   INNER JOIN Location ON detail.Location = Location.Location
  ) 
  INNER JOIN TagBarCode ON (detail.RootPlu = TagBarCode.Plu) AND (detail.Size = TagBarCode.Size)
 ) 
 INNER JOIN VatRate ON detail.VCode = VatRate.Vcode
GROUP BY 
    Orders.OrderNumber, 
    Orders.OrderLine, 
    Orders.Orderdate, 
    Orders.Deldate, 
    Orders.CutOffDate, 
    detail.Location, 
    Location.Description, 
    TagBarCode.TagBcode, 
    detail.PLU, 
    Style.Description, 
    Orders.OnOrder, 
    StockType.Description, 
    VatRate.Vcode, 
    VatRate.Vatname, 
    VatRate.VatRate, 
    orders.cost;

1 个答案:

答案 0 :(得分:0)

显然你需要这样做[位置]。[描述]描述是保留字