没想到今天会这么晚才睡觉,在送走我的宝宝后,我平静下来想把公司的客户端的VC读写存储过程的方法好好整理一下,因为这个解决方案还没有最终做好,我有责任把这个问题完备的解决掉,vc进行一些高级的数据库操作确实显得很麻烦,这点做的不如.net好,但是作为一个客户端软件也必须要具备这个功能,在认真进行配合编码后,正确的结果出现了,我很兴奋,很长时间没有这种在写出一个认为较难实现的东东后的兴奋感了,可能是宝宝给我的运气,核心代码如下 :
CADOParameter pParamIn(CADORecordset::typeChar, sizeof(char)*50);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CString a="guanchanghui";
pParamIn.SetValue(a);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CADOCommand pCmd(&m_pDb, "GetPrivateServer");
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
pCmd.AddParameter(&pParamIn);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
CADORecordset* prs = new CADORecordset(&m_pDb);
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
if(m_pRs.Execute(&pCmd))
{
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
if(m_pRs.Execute(&pCmd))
{
//执行SELETE语句
_RecordsetPtr m_pRecordset;
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
while (!m_pRs.IsEOF())
{
m_pRecordset=m_pRs.GetRecordset();
CString ServerIP,RoleName;
ServerIP = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("serverip");
RoleName = (LPCTSTR)(_bstr_t)m_pRecordset->GetCollect("RoleName");
m_serverip+=ServerIP+" "+RoleName;
m_serverip+=" ";
UpdateData(FALSE);
m_pRs.MoveNext();
}
}
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
}
真的不是很复杂,所以不论什么事情耐心和认真的态度是必备的,公司里的事情也如此我也是这样认为的,与人的沟通上面也是要有耐心,公司的成长上面也是要有耐心的,用一句话来勉励自己吧,既然选择了远方,便只顾风雨兼程。
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gif)
![](http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif)
delete prs;