我先创建了一个程序,对应了数据库中的一个表,这个表中有一列每一个字段是不重复的,我把它加入到了一个ccombobox里边,然后我想根据在对话框中选定的这个字段来打开另外一个表,把另外一个表的某一列的字段添加到该对话框上另外一个combobox中去,今天上午试了一个上午总是不行,不知道哪位能知道一下小弟?
我对第一个ccombobox控件添加了一个onseleok函数。
我对第一个ccombobox控件添加了一个onseleok函数。
解决方案 »
- 树形控件设置icon图标不显示
- SQL写库错误
- 关于WINDOWS XP 的安全模式问题(昆明)?
- 求助:光标定位新问题
- 菜菜菜鸟问
- 下载了一个C程序,没有工程文件,我建立了工程文件又不能编译,但是里面有个makefile 不知道怎么编译?
- CString的对象该怎么释放啊?
- VC批量写入excel文件,超链接无法正常链接,显示的是excel函数字符串
- 救命啊(m_pConnection->Execute)
- 钩子问题
- 1 ADO连接ACCESS时在没装VC的电脑上出错误 2 我这个程序服务器端要在固定的IP上运行,客户端有ADSL拨号的局域网能访问服务器端吗?
- 用按钮引入编辑框里的内容GetDlgItem()怎么找不到IDC开头的ID啊?
{
// TODO: Add your control notification handler code here
CString strProduct;
m_Product.GetLBText(m_Product.GetCurSel(),strProduct);
if(strProduct.IsEmpty()){
AfxMessageBox("请选取产品名称!");
return;
}
CString strSQL;
strSQL.Format("SELECT DISTINCT 产品规格 FROM 业务订单表\
WHERE 产品名称='%s'",
strProduct);
try{
theApp.m_pSet->Open(strSQL.AllocSysString(),
theApp.m_pConn.GetInterfacePtr(),
adOpenDynamic,
adLockOptimistic,
adCmdText);
if(theApp.m_pSet->BOF&&theApp.m_pSet->adoEOF){
theApp.m_pSet->Close();
return;
}
else{
theApp.m_pSet->MoveFirst();
while(!theApp.m_pSet->adoEOF){
if(theApp.m_pSet->GetCollect("产品规格").vt!=VT_NULL){
CString strVal=theApp.m_pSet->GetCollect("产品规格").bstrVal;
if(!strVal.IsEmpty()){
m_Spec.AddString(strVal);
}
}
theApp.m_pSet->MoveNext();
}
theApp.m_pSet->Close();
}
}
catch(_com_error& e){
AfxMessageBox(e.Description());
}
}