徐
徐凤华
Unregistered / Unconfirmed
GUEST, unregistred user!
代码如下:
SQLClientDataSet1.Close;
SQLClientDataSet1.CommandText := 'Select * From T_User where UserName=:Name';
SQLClientDataSet1.Params[0].AsString := 'FRANK';
SQLClientDataSet1.Open;
每次程序都会报错:
List Index out of Bounds(0);
若改为:
SQLClientDataSet1.Close;
SQLClientDataSet1.CommandText := 'Select * From T_User where UserName=:Name';
SQLClientDataSet1.Params.ParamByName('Name').AsString := 'FRANK';
SQLClientDataSet1.Open;
则提示:
Parameter 'Name' not found
但在属性编辑器中,使用参数则一切正常。
真是令人莫名其妙?
SQLClientDataSet1.Close;
SQLClientDataSet1.CommandText := 'Select * From T_User where UserName=:Name';
SQLClientDataSet1.Params[0].AsString := 'FRANK';
SQLClientDataSet1.Open;
每次程序都会报错:
List Index out of Bounds(0);
若改为:
SQLClientDataSet1.Close;
SQLClientDataSet1.CommandText := 'Select * From T_User where UserName=:Name';
SQLClientDataSet1.Params.ParamByName('Name').AsString := 'FRANK';
SQLClientDataSet1.Open;
则提示:
Parameter 'Name' not found
但在属性编辑器中,使用参数则一切正常。
真是令人莫名其妙?