作业帮 > 综合 > 作业

关于PB 中 types of expressions must match

来源:学生作业帮 编辑:搜搜做题作业网作业帮 分类:综合作业 时间:2024/08/08 11:27:11
关于PB 中 types of expressions must match
string lookforcondition
string lookforitem1
string lookforhow1
string lookforwhat1
int current_row
int total_row
int find_row
lookforhow1=ddlb_2.text
if ddlb_1.text="学号" then
lookforitem1="Sno"
lookforwhat1=sle_1.text
elseif ddlb_1.text="姓名" then
lookforitem1="Sname"
lookforwhat1=""+sle_1.text+""
elseif ddlb_1.text="性别" then
lookforitem1="Sex"
lookforwhat1=""+sle_1.text+""
elseif ddlb_1.text="生日" then
lookforitem1="Birth"
lookforwhat1=""+sle_1.text+""
elseif ddlb_1.text="地址" then
lookforitem1="Address"
lookforwhat1=""+sle_1.text+""
elseif ddlb_1.text="身份证号" then
lookforitem1="Idnum"
lookforwhat1=""+sle_1.text+""
end if
lookforcondition=lookforitem1+lookforhow1+""+lookforwhat1+""
current_row=dw_1.getrow()
total_row=dw_1.rowcount()
find_row=dw_1.find(lookforcondition,current_row,total_row)
if find_row>0 then
dw_1.SelectRow(0,false)
dw_1.SelectRow(find_row,true)
dw_1.SetRowFocusIndicator(off!)
else
MessageBox("注意","没有符合条件的内容")
end if
运行后出现这个问题 types of expressions must match!
我的查询表的字段是:
create table S
( sno varchar(10) not null,
sname varchar(10) not null,
address varchar(30) not null,
dno varchar(10) not null,
birth varchar(10) not null,
sex varchar(10) not null,
minzu varchar(10) not null,
idnum varchar(20) not null
primary key (sno),
foreign key(dno)references D(dno)
)
关于PB 中 types of expressions must match
试试下面这个,如果有问题,再补充说明.
string lookforcondition
string lookforitem1
string lookforhow1
string lookforwhat1
int current_row
int total_row
int find_row
lookforhow1=ddlb_2.text
if ddlb_1.text="学号" then
lookforitem1="Sno"
elseif ddlb_1.text="姓名" then
lookforitem1="Sname"
elseif ddlb_1.text="性别" then
lookforitem1="Sex"
elseif ddlb_1.text="生日" then
lookforitem1="Birth"
elseif ddlb_1.text="地址" then
lookforitem1="Address"
elseif ddlb_1.text="身份证号" then
lookforitem1="Idnum"
end if
lookforwhat1=sle_1.text
lookforcondition=lookforitem1+lookforhow1+"'"+lookforwhat1+"'"
current_row=dw_1.getrow()
total_row=dw_1.rowcount()
find_row=dw_1.find(lookforcondition,current_row,total_row)
if find_row>0 then
dw_1.SelectRow(0,false)
dw_1.SelectRow(find_row,true)
dw_1.SetRowFocusIndicator(off!)
else
MessageBox("注意","没有符合条件的内容")
end if