我的sql错在哪里呢
在ddlb_1 的selctchanged事件中
//结果ddlb_2没有显示任何的内容??????
//我的意图是想通过ddlb_1的选择动态来显示字段,
而显示的字段不是用来定位内容的,只是提供给用户
一个友好的界面,所以我用了另一个select语句来得出
它的另一个关键字段,通过表关联,达到动态效果
string ls_proname(专业号),ls_xiid(系号),ls_xiname(系名)
******************************
int i=1
ls_xiname=this.text(index)
ddlb_2.reset()
select Xiid into :ls_xiid
from yuanxi
where xiname = :ls_xiname
using sqlca;
DECLARE XiPro CURSOR FOR
SELECT proname
FROM professional
where professional.xiid = :ls_xiid
USING SQLCA;
CONNECT USING SQLCA;
IF SQLCA.SQLCode <> 0 THEN
MessageBox("提示信息","数据库连接失败" &
+ SQLCA.SQLErrText)
RETURN
END IF
OPEN XiPro;
IF SQLCA.SQLCode <> 0 THEN
MessageBox("提示信息","数据库连接失败" &
+ SQLCA.SQLErrText)
RETURN
END IF
FETCH XiPro INTO :ls_proname;
//在这而messagebox()有反应,
do while sqlca.sqlcode=0
//我在这个用message()测试,没反应
//说明sqlca.sqlcode<>0
//???????????????
ddlb_2.insertitem(string(ls_proname),i)
i = i + 1
FETCH XiPro INTO :ls_proname;
loop
CLOSE XiPro;
DISCONNECT USING SQLCA;