HZADOQuery.SQL:='SELECT dwmc as [HZfield], sum(ysje) AS [counter] FROM main GROUP BY dwmc'; 这样写说类型不匹配,应该怎么写才正确.
HZADOQuery.SQL.Text:='SELECT dwmc as [HZfield], sum(ysje) AS [counter] FROM main GROUP BY dwmc';
TStrings和String是两个概念呀,建议你看一下TStrings的帮助:Derive a class from TStrings to store and manipulate a list of strings. TStrings contains abstract methods and should not be directly instantiated.Descendants of TStrings can represent several individual strings, such as the individual lines that appear in a list box. Some objects use descendants of TStrings to represent one long body of text so that it can be manipulated in smaller chunks.
HZADOQuery.Close; HZADOQuery.SQL.Clear; HZADOQuery.SQL.Add('SELECT dwmc as [HZfield], sum(ysje) AS [counter] FROM main GROUP BY dwmc'); HZADOQuery.Open;
这样写说类型不匹配,应该怎么写才正确.
HZADOQuery.SQL.Clear;
HZADOQuery.SQL.Add('SELECT dwmc as [HZfield], sum(ysje) AS [counter] FROM main GROUP BY dwmc');
HZADOQuery.Open;