⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gukexuqiuvsbijiaoduixiang.cpp

📁 QFD是一种十分有效的质量管理工具
💻 CPP
📖 第 1 页 / 共 2 页
字号:
			 strSQL3.Format("select c from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	//上述准备完毕,下面开始插入内容
	try
	{
	
	 m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("c")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 4:
			 strSQL3.Format("select d from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	//上述准备完毕,下面开始插入内容
	try
	{
	
	   m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("d")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 5:
			 strSQL3.Format("select e from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
     
	//上述准备完毕,下面开始插入内容
	try
	{
	
	  m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("e")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 6:
			 strSQL3.Format("select f from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
    
	//上述准备完毕,下面开始插入内容
	try
	{
	
	  m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("f")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 7:
			 strSQL3.Format("select g from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	//上述准备完毕,下面开始插入内容
	try
	{
	
	   m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("g")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 8:
			 strSQL3.Format("select h from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
    
	try
	{
	
	   m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("h")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 9:
			 strSQL3.Format("select i from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
    
	try
	{
	
	  m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("i")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 10:
			 strSQL3.Format("select j from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	try
	{
	
	 m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("j")));
	    UpdateData(false);
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;
			default:break;
		}	//打开记录集 选择表名
   

}
else{}
	
	
}

void CgukexuqiuVSbijiaoduixiang::OnClickDatalist2() 
{
 UpdateData(true);//更新编辑框,并且将当前编辑框的数值赋给m_xishu
  int index1=0,index2=0;
 
   CString term1;
   CString term2;

   term1=m_list1.GetText();
   term2=m_list2.GetText();

  
   	if(term1!="")
	{
   CString strSQL1;
	strSQL1.Format("select * from 顾客需求 where 顾客需求='%s' \
	",\
		term1
		);
	//打开记录集 选择表名
	if(!OpenRecordSet(m_pRecordset,strSQL1))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}	
   CString cindex1=VariantToCString(m_pRecordset->GetCollect("ID"));
   index1=atoi(cindex1);
	//关闭
	m_pRecordset->Close();
	m_pRecordset=NULL;


    CString strSQL2;
	strSQL2.Format("select * from 比较对象 where 比较对象='%s' \
	",\
		term2
		);
	//打开记录集 选择表名
	if(!OpenRecordSet(m_pRecordset,strSQL2))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}	

	CString cindex2=VariantToCString(m_pRecordset->GetCollect("ID"));
    index2=atoi(cindex2);

    //关闭
	m_pRecordset->Close();
	m_pRecordset=NULL;
	
   

    // m_xishu=index1;
    //UpdateData(false);  //更新编辑框,但不将当前编辑框的数值赋给m_xishu

    // AfxMessageBox(term1 + "  "+ term2+"  " + cindex1+ "   "  +cindex2);

    CString strSQL3;
	CString a;
    switch(index1){
		case 1:
			 strSQL3.Format("select a from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);

			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
    //a.Format("%d",m_xishu);   
	//上述准备完毕,下面开始插入内容
	try
	{
	
	  // m_pRecordset->PutCollect("a",_variant_t(a));
		
	    m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("a")));
	    UpdateData(false);
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 2:
			 strSQL3.Format("select b from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	//上述准备完毕,下面开始插入内容
	try
	{
	
	  m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("b")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 3:
			 strSQL3.Format("select c from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	//上述准备完毕,下面开始插入内容
	try
	{
	
	 m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("c")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 4:
			 strSQL3.Format("select d from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	//上述准备完毕,下面开始插入内容
	try
	{
	
	   m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("d")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 5:
			 strSQL3.Format("select e from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
     
	//上述准备完毕,下面开始插入内容
	try
	{
	
	  m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("e")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 6:
			 strSQL3.Format("select f from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
    
	//上述准备完毕,下面开始插入内容
	try
	{
	
	  m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("f")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 7:
			 strSQL3.Format("select g from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	//上述准备完毕,下面开始插入内容
	try
	{
	
	   m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("g")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 8:
			 strSQL3.Format("select h from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
    
	try
	{
	
	   m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("h")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 9:
			 strSQL3.Format("select i from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
    
	try
	{
	
	  m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("i")));
	    UpdateData(false);
	
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;

			case 10:
			 strSQL3.Format("select j from 需求和比较对象关系表 where ID='%s'  \
		",\
		cindex2);
			 	if(!OpenRecordSet(m_pRecordset,strSQL3))
	{
		AfxMessageBox("没有成功打开数据表");
		return;
	}

    
   
	try
	{
	
	 m_xishu=atoi(VariantToCString(m_pRecordset->GetCollect("j")));
	    UpdateData(false);
	
		//更新数据库
		m_pRecordset->Update();		
	
	}
	catch(_com_error e)
	{
		CString strError;
		strError.Format("警告: 插入信息时发生异常。 错误信息: %s",\
			e.ErrorMessage());
		AfxMessageBox(strError);
	}
	m_pRecordset->Close();	
	m_pRecordset=NULL;
			break;
			default:break;
		}	//打开记录集 选择表名
   

}
else{}
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -