程序调试,该怎么处理
发布时间:2011-06-28 23:50:32 文章来源:www.iduyao.cn 采编人员:星星草
程序调试
void CStore::OnButenrol()
{
// TODO: Add your control notification handler code here
CString sField;
m_ComField.GetWindowText(sField);
CString sEmblem;
m_ComEmblem.GetWindowText(sEmblem);
CString sCondition;
m_EdtCondition.GetWindowText(sCondition);
CString sSQL;
if(sEmblem!="LIKE")
sSQL.Format("SELECT * from 库存设备表 WHERE %s %s '%s'",sField,sEmblem,sCondition);
else
sSQL.Format("SELECT * from 库存设备表 WHERE %s LIKE '%s%%'",sField,sCondition);
try{
rst=cnn->Execute((_bstr_t)sSQL,NULL,adCmdText);
}
catch(...)
{
theApp.ADOError(rst);
}
if(theApp.GetRecordCount(rst)>0)
{
CString sTBName;
m_TBName.GetWindowText(sTBName);
if (sTBName.IsEmpty())
{
MessageBox("请选择目的表!","系统提示",MB_OK|MB_ICONSTOP);
m_TBName.SetFocus();
return;
}
if (sTBName=="采购计划表")
{
rst->MoveFirst();
CString sName;
sName=(char*)(_bstr_t)rst->GetCollect("设备名称");
CString sSQL1;
sSQL1.Format("SELECT * FROM 采购计划表 WHERE 采购设备名称='%s' ",sName);
_RecordsetPtr AutoNumber_Rst2;
AutoNumber_Rst2.CreateInstance(__uuidof(Recordset));
try
{
AutoNumber_Rst2=cnn->Execute((_bstr_t)sSQL1,NULL,adCmdText);
}
catch (...)
{
theApp.ADOError(AutoNumber_Rst2);
}
AutoNumber_Rst2->MoveFirst();
_variant_t value;
value=(_bstr_t)AutoNumber_Rst2->GetCollect("数量");
int nNumber=1;
if(value.vt==VT_NULL)
{
_RecordsetPtr AutoNumber_Rst3;
AutoNumber_Rst3.CreateInstance(__uuidof(Recordset));
nNumber=1;
sSQL.Format("insert into 采购计划表 values('%S',%d)",sName,nNumber);
try
{
AutoNumber_Rst3=cnn->Execute((_bstr_t)sSQL,NULL,adCmdText);
}
catch (...)
{
theApp.ADOError(AutoNumber_Rst3);
}
AutoNumber_Rst3->Close();
}
else
{
_RecordsetPtr AutoNumber_Rst3;
AutoNumber_Rst3.CreateInstance(__uuidof(Recordset));
nNumber=atoi((char*)(_bstr_t)value)+1;
sSQL.Format("UPDATE 采购计划表 SET 数量=%d",nNumber);
try
{
AutoNumber_Rst3=cnn->Execute((_bstr_t)sSQL,NULL,adCmdText);
}
catch (...)
{
theApp.ADOError(AutoNumber_Rst3);
}
AutoNumber_Rst3->Close();
}
AutoNumber_Rst2->Close();
MessageBox("请选择记录!","系统提示",MB_OK|MB_ICONSTOP);
}
}
rst->Close();
}
我想知道为什么,帮忙看一下
------解决方案--------------------
头晕。。。你想问什么啊
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
其他相似内容:
-
身为程序员一定要学C吗?还是直接学其他语言就可以了?
本来有javascript基础.
但想学c++或者c#.不知道从何开始.
有一次在某网站看...
-
有用双屏幕开发的吗?
RT,本人新手,昨天公司发了个大屏幕的显示器,本来是笔记本,结果我双屏幕切换时把两个显卡驱动都禁用了,两个显示器...
-
急!Microsoft Visual Studio 2010图标显示问题!
一开始我是把VS的那个无穷大似的图标锁定在任务栏里的,后来解锁了,然后桌面上、开始...
-
AIX下如何得知一个文件是否被进程打开?
问题可以参考
http://topic.csdn.net/u/20110809/23/d4d8db23-07eb-4ac3-b212-c5a010820c...
-
推荐一款2000左右的智能机
RT~
------解决方案--------------------
merry christmas
------解决方案--------------------
小...
-
关于 % 的小问题,求解
有这样一句提示信息:
printf("n请输入一个型如2+3*(4+5)-3^2%4*6/2的表达式n");
但在运行后输出是:
请输入...
-
新手求助
大家好,鄙人刚来,菜鸟一个,想知道如何下载别人上传的资源,为什么没有下载链接,是需要一定的分数才能下载还是怎么回事?希望好...
-
CSDN有搜索自己发言或者某人发言的功能吗
请指教
------解决方案--------------------
没有。。。
------解决方案------------...
-
订到2张回成都的车票, 不容易啊, 散分
12点左右就每5分钟刷一次, 从13号到16号就一直只有无坐...
13:55 刷出3张硬卧, 大喜, 结...
-
计算机专业大四应该学点什么东西呢?
我现在的情况是已经保研,计算机专业专业硕士。现在大四上半学期快结束了,寒假和下学期除了毕业...