提示错误代码如下:
Project ExpertExtract.exe raised exception class EOLeException with message'类型不匹配。'. Process stooped. Use Setp or Run to continue.
Project ExpertExtract.exe raised exception class EOLeException with message'类型不匹配。'. Process stooped. Use Setp or Run to continue.
解决方案 »
- 下面代码错在哪(2006下运行正常,2007下面产生如下错误)
- 怎样用DBexpress存取oracle的blob字段? 100分有尽有 ---急!!!
- 怎样检查一个字符串是一个有效的路径?
- 为什么TServerSocket.serverType = stThreadblocking时OnClientConnect事件不触发
- 关于WNetAddConnection用法
- 你的舉手之勞,在Delphi中怎樣實現SQLServer數據庫的備份?
- 如何采用三层结构调用ORACLE的存储过程?带参数!!返回游标或变量!
- 判断一个字符串是不是数字用什么函数?
- 谁有Delphi编程标准类的文档?
- 天价求解,我想做一个ASP编辑器,现在就差按下点“.”得到属性了
- 有关程序执行时提示错误的?
- 有关delphi程序退出的问题?
var
sGroupId, sSearch,sReturn :string;
iOptioncount,IExtracount :integer;
tempArray1: array of integer;
i :integer;
begin sReturn :='';
sSearch :='';
GsSearch :=''; //浏览ExpertGroup表
ADOTable1.First;
while not ADOTable1.Eof do
begin
SGroupId :=ADOTable1.FieldValues['组ID'];
IOptioncount :=ADOTable1.FieldValues['总人数'];
IExtracount :=ADOTable1.FieldValues['抽选人数'];
if IExtracount <=0 then
begin
ADOTable1.Next;
continue; // 抽选人数为0,则跳出本次循环
end; if IExtracount > IOptioncount then
begin
Application.MessageBox('抽选人数不能大于总人数, 请重新输入. ', '提示信息', MB_OK);
exit;
end;
//计算出每组选中的专家总人数
with ADOQuery1 do begin
Close;
Connection :=frmMain.ADOConnection1;
SQL.Clear;
SQL.Add('select * from Expert where 组ID like :GroupID and 选中= 1 Order by 组ID asc,专家ID asc');
Parameters.ParamByName('GroupID').Value := SGroupId; Prepared :=true;
Open; //select语句需用Open方法执行
end; if IExtracount > ADOQuery1.RecordCount then
begin
Application.MessageBox('抽选人数不能大于该组选中的专家总人数, 请重新输入. ', '提示信息', MB_OK);
exit;
end;
setlength(TempArray1,IExtracount); //根据抽选人数为数组分配内存空间
//调用抽取函数, ADOQuery1.RecordCount是有效的专家总人数
sReturn :=ExtractFunc(ADOQuery1.RecordCount,IExtracount,TempArray1); for i :=low(TempArray1) to high(TempArray1) do
begin
ADOQuery1.first;
ADOQuery1.MoveBy(TempArray1[i]-1);
//构造查询字符串
sSearch :=sSearch + ''''+inttostr(ADOQuery1.fieldbyname('专家ID').Value)+''',';
GsSearch := GsSearch + '专家ID = ' + QuotedStr(ADOQuery1.FieldValues['专家ID']) + ' OR ';
end;
ADOTable1.Next;
end;
ADOTable1.First; //完成浏览ExpertGroup表 tempArray1 :=nil; //释放临时数组内存空间
if sSearch = '' then //如果没有构造查询字符串,则构造
begin
sSearch :='''' + '''';
GsSearch :='专家ID = ' + QuotedStr('')
end
else begin
sSearch :=copy(sSearch,1,length(sSearch)-1); //去掉结尾的逗号
GsSearch :=copy(GsSearch,1,length(GsSearch)-3); //去掉结尾的OR
end;
sSearch := 'select * from Expert where 专家ID in (' + sSearch + ') ' +
' Order by 类ID asc,专家ID asc'; with ADOQuery1 do begin
Close;
SQL.Clear;
SQL.Add(sSearch);
Prepared :=true;
Open; //select语句需用Open方法执行
end; frmExtract1Rep :=TfrmExtract1Rep.Create(Application);
button3.Enabled :=true;
with frmExtract1Rep.ADOTable1 do
begin
Close;
Connection:=frmMain.ADOConnection1;
TableName:='Expert'; //数据表名称!
Filtered := False;
Filter :=GsSearch ;
Filtered :=true;
Open; //打开数据库表
end;
DBGrid2.Enabled:=true;
DBGrid2.Visible :=true;
DBGrid3.Enabled :=false;
DBGrid3.Visible :=false;
Label1.Caption :='抽取结果:';
end;
我设置了一下断点跟踪了一下,发现当运行到程序的倒数第八行的Open时,提示了我先前提出的问题的“类型不匹配”。
应该怎么处理。