with datamodule2.Query_inventory do
        begin
          Close;   
          databasename:=’case’;
          sql.Clear;

解决方案 »

  1.   

    sql.Add(’select * from collect where (partno between :Startcode and :stopcode) and (batchno between :Startbatchno and :stopbatchno)’);
    //主要是上面那句,怎么运行不行啊?
      

  2.   

    sql.Add(‘select * from collect where partno between :Startcode and :stopcode and batchno between :Startbatchno and :stopbatchno’);
    改为:
    sql.Add('  select * from collect where partno between :'+
            '''  Startcode'' and  :''stopcode'' and batchno'+
            '  between  :''Startbatchno'' and  :''stopbatchno''');
    //你程序中有一个“'”写成了“’”
      

  3.   

    databasename:=’case’;
    case是关键字,改用databasename:=’[case]’;