主题:在pb中如何将数据库数据读入Grid的下拉列表中
源程序************************************************
dw_1.GetChild ("sjcqqxzmc", ii_sjcq1)
CONNECT USING SQLCA;
ii_sjcq1.SetTransObject (sqlca)
ll_rows = ii_sjcq1.Retrieve (g_dwbm+'%')
IF ll_rows < 1 THEN
MessageBox( "数据提取错误","没有下属单位!")
close(this)
return
end if
dw_2.GetChild ("sjcqqxzmc", ii_sjcq2)
CONNECT USING SQLCA;
ii_sjcq2.SetTransObject (sqlca)
ll_rows = ii_sjcq2.Retrieve (g_dwbm+'%')
IF ll_rows < 1 THEN
MessageBox( "数据提取错误","没有下属单位!")
close(this)
return
end if
*************************************************************
//新加
// Profile erererer
SQLCA.DBMS = "MSS Microsoft SQL Server 6.x"
SQLCA.Database = "rsk"
SQLCA.LogPass = "sa"
SQLCA.ServerName = "hbserver"
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = ""
dw_1.GetChild("yhmc",ii_yhxm1)
CONNECT USING SQLCA;
//dw_1.SetSqlSelect("select yhmc from yhxx")
ii_yhxm1.SetTransObject(sqlca)
ll_rows=ii_yhxm1.Retrieve()
IF ll_rows<1 THEN
MessageBox("数据提取错误",ll_rows)
close(this)
return
END IF
dw_2.GetChild("yhmc",ii_yhxm2)
CONNECT USING SQLCA;
ii_yhxm2.SetTransObject(sqlca)
ll_rows=ii_yhxm2.Retrieve()
IF ll_rows<1 THEN
MessageBox("数据提取错误","没有人员信息!")
close(this)
return
END IF
原程序是连接Oracel数据库的,我现在要连接SQL Server数据库,从中读取用户姓名并将数据放入Grid得下拉列表中,请问该如何做??????
dw_1.GetChild ("sjcqqxzmc", ii_sjcq1)
CONNECT USING SQLCA;
ii_sjcq1.SetTransObject (sqlca)
ll_rows = ii_sjcq1.Retrieve (g_dwbm+'%')
IF ll_rows < 1 THEN
MessageBox( "数据提取错误","没有下属单位!")
close(this)
return
end if
dw_2.GetChild ("sjcqqxzmc", ii_sjcq2)
CONNECT USING SQLCA;
ii_sjcq2.SetTransObject (sqlca)
ll_rows = ii_sjcq2.Retrieve (g_dwbm+'%')
IF ll_rows < 1 THEN
MessageBox( "数据提取错误","没有下属单位!")
close(this)
return
end if
*************************************************************
//新加
// Profile erererer
SQLCA.DBMS = "MSS Microsoft SQL Server 6.x"
SQLCA.Database = "rsk"
SQLCA.LogPass = "sa"
SQLCA.ServerName = "hbserver"
SQLCA.LogId = "sa"
SQLCA.AutoCommit = False
SQLCA.DBParm = ""
dw_1.GetChild("yhmc",ii_yhxm1)
CONNECT USING SQLCA;
//dw_1.SetSqlSelect("select yhmc from yhxx")
ii_yhxm1.SetTransObject(sqlca)
ll_rows=ii_yhxm1.Retrieve()
IF ll_rows<1 THEN
MessageBox("数据提取错误",ll_rows)
close(this)
return
END IF
dw_2.GetChild("yhmc",ii_yhxm2)
CONNECT USING SQLCA;
ii_yhxm2.SetTransObject(sqlca)
ll_rows=ii_yhxm2.Retrieve()
IF ll_rows<1 THEN
MessageBox("数据提取错误","没有人员信息!")
close(this)
return
END IF
原程序是连接Oracel数据库的,我现在要连接SQL Server数据库,从中读取用户姓名并将数据放入Grid得下拉列表中,请问该如何做??????