关于PB 中 types of expressions must matchstring lookforconditionstring lookforitem1string lookforhow1string lookforwhat1int current_rowint total_rowint find_rowlookforhow1=ddlb_2.textif ddlb_1.text="学号" thenlookforitem1="Sno"lookforwhat1=sle_1

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/23 14:16:44
关于PB中typesofexpressionsmustmatchstringlookforconditionstringlookforitem1stringlookforhow1stringlookf

关于PB 中 types of expressions must matchstring lookforconditionstring lookforitem1string lookforhow1string lookforwhat1int current_rowint total_rowint find_rowlookforhow1=ddlb_2.textif ddlb_1.text="学号" thenlookforitem1="Sno"lookforwhat1=sle_1
关于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 matchstring lookforconditionstring lookforitem1string lookforhow1string lookforwhat1int current_rowint total_rowint find_rowlookforhow1=ddlb_2.textif ddlb_1.text="学号" thenlookforitem1="Sno"lookforwhat1=sle_1
试试下面这个,如果有问题,再补充说明.
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