﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-huahit-最新评论</title><link>http://www.cppblog.com/huahit/CommentsRSS.aspx</link><description /><language>zh-cn</language><pubDate>Thu, 01 Aug 2013 08:42:50 GMT</pubDate><lastBuildDate>Thu, 01 Aug 2013 08:42:50 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: 人生的选择 zz</title><link>http://www.cppblog.com/huahit/archive/2009/12/04/42560.html#102521</link><dc:creator>yz</dc:creator><author>yz</author><pubDate>Fri, 04 Dec 2009 03:17:00 GMT</pubDate><guid>http://www.cppblog.com/huahit/archive/2009/12/04/42560.html#102521</guid><description><![CDATA[呵呵 师兄加油！<img src ="http://www.cppblog.com/huahit/aggbug/102521.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huahit/" target="_blank">yz</a> 2009-12-04 11:17 <a href="http://www.cppblog.com/huahit/archive/2009/12/04/42560.html#102521#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>请问1204用什么可以代换</title><link>http://www.cppblog.com/huahit/archive/2007/07/16/7425.html#28129</link><dc:creator>路路十八弯</dc:creator><author>路路十八弯</author><pubDate>Mon, 16 Jul 2007 08:02:00 GMT</pubDate><guid>http://www.cppblog.com/huahit/archive/2007/07/16/7425.html#28129</guid><description><![CDATA[请问1204用什么可以代换<img src ="http://www.cppblog.com/huahit/aggbug/28129.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huahit/" target="_blank">路路十八弯</a> 2007-07-16 16:02 <a href="http://www.cppblog.com/huahit/archive/2007/07/16/7425.html#28129#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: VC环境下对函数调用的汇编分析</title><link>http://www.cppblog.com/huahit/archive/2006/05/30/3874.html#7874</link><dc:creator>funny</dc:creator><author>funny</author><pubDate>Tue, 30 May 2006 06:10:00 GMT</pubDate><guid>http://www.cppblog.com/huahit/archive/2006/05/30/3874.html#7874</guid><description><![CDATA[.h的代码为:<br>#import &quot;c:\Program Files\Common Files\System\ado\msado15.dll&quot; no_namespace rename(&quot;EOF&quot;,&quot;adoEOF&quot;) rename(&quot;BOF&quot;,&quot;adoBOF&quot;)<br><br>#if !defined(AFX_ADOCONN_H__79514B46_ED08_4C99_BFB1_200CDAC82054__INCLUDED_)<br>#define AFX_ADOCONN_H__79514B46_ED08_4C99_BFB1_200CDAC82054__INCLUDED_<br><br>#if _MSC_VER &gt; 1000<br>#pragma once<br>#endif // _MSC_VER &gt; 1000<br><br>class ADOConn  <br>{<br>// 定义变量<br>public:<br>	//添加一个指向Connection对象的指针:<br>	_ConnectionPtr m_pConnection;<br>	//添加一个指向Recordset对象的指针:<br>	_RecordsetPtr m_pRecordset;<br>// 定义方法<br>public:<br>	ADOConn();<br>	virtual ~ADOConn();<br>	// 初始化—连接数据库<br>	void  OnInitADOConn();<br>	// 执行查询<br>	_RecordsetPtr&amp; GetRecordSet(_bstr_t bstrSQL);<br>	// 执行SQL语句，Insert Update _variant_t<br>	BOOL ExecuteSQL(_bstr_t bstrSQL);<br>	void ExitConnect();<br><br>};<br><br><br><br>.cpp的代码为：<br><br>#include &quot;stdafx.h&quot;<br>#include &quot;Fstore.h&quot;<br>#include &quot;ADOConn.h&quot;<br><br>#ifdef _DEBUG<br>#undef THIS_FILE<br>static char THIS_FILE[]=__FILE__;<br>#define new DEBUG_NEW<br>#endif<br><br>//////////////////////////////////////////////////////////////////////<br>// Construction/Destruction<br>//////////////////////////////////////////////////////////////////////<br><br>ADOConn::ADOConn()<br>{<br><br>}<br><br>ADOConn::~ADOConn()<br>{<br><br>}<br>void  ADOConn::OnInitADOConn()<br>{<br>	// 初始化OLE/COM库环境 <br>	::CoInitialize(NULL);<br>  <br>	try<br>	{<br>		// 创建Connection对象<br>		m_pConnection.CreateInstance(&quot;ADODB.Connection&quot;);<br>		<br>		m_pConnection-&gt;Open(&quot;Provider=SQLOLEDB;Server=JINAN-JEL9I8QQ2\STORE;Database=FStore; uid=sa; pwd=funny817&quot;,&quot;&quot;,&quot;&quot;,adModeUnknown);<br>	}<br>	// 捕捉异常<br>	catch(_com_error e)<br>	{<br>		// 显示错误信息<br>		AfxMessageBox(e.Description());<br>	}<br>}<br><br>// 执行查询<br>_RecordsetPtr&amp;  ADOConn::GetRecordSet(_bstr_t bstrSQL)<br>{<br>	try<br>	{<br>		// 连接数据库，如果Connection对象为空，则重新连接数据库<br>		if(m_pConnection==NULL)<br>			OnInitADOConn();<br>		// 创建记录集对象<br>		m_pRecordset.CreateInstance(__uuidof(Recordset));<br>		// 取得表中的记录<br>		m_pRecordset-&gt;Open(bstrSQL,m_pConnection.GetInterfacePtr(),adOpenDynamic,adLockOptimistic,adCmdText);<br>	}<br>	// 捕捉异常<br>	catch(_com_error e)<br>	{<br>		// 显示错误信息<br>		AfxMessageBox(e.Description());<br>	}<br>	// 返回记录集<br>	return m_pRecordset;<br>}<br><br> // 执行SQL语句，Insert Update _variant_t<br>BOOL ADOConn::ExecuteSQL(_bstr_t bstrSQL)<br>{<br>//	_variant_t RecordsAffected;<br>	try<br>	{<br>		// 是否已经连接数据库<br>		if(m_pConnection == NULL)<br>			OnInitADOConn();<br>		// Connection对象的Execute方法:(_bstr_t CommandText, <br>		// VARIANT * RecordsAffected, long Options ) <br>		// 其中CommandText是命令字串，通常是SQL命令。<br>		// 参数RecordsAffected是操作完成后所影响的行数, <br>		// 参数Options表示CommandText的类型：adCmdText-文本命令；adCmdTable-表名<br>		// adCmdProc-存储过程；adCmdUnknown-未知<br>		m_pConnection-&gt;Execute(bstrSQL,NULL,adCmdText);<br>		return true;<br>	}<br>	catch(_com_error e)<br>	{<br>		AfxMessageBox(e.Description());<br>		return false;<br>	}<br>}<br><br>void ADOConn::ExitConnect()<br>{<br>	// 关闭记录集和连接<br>	if (m_pRecordset != NULL)<br>		m_pRecordset-&gt;Close();<br>	m_pConnection-&gt;Close();<br>	// 释放环境<br>	::CoUninitialize();<br>}<br><br><br>就是没办法链接到数据库，请大人帮忙看看！！！！<img src ="http://www.cppblog.com/huahit/aggbug/7874.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huahit/" target="_blank">funny</a> 2006-05-30 14:10 <a href="http://www.cppblog.com/huahit/archive/2006/05/30/3874.html#7874#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: VC环境下对函数调用的汇编分析</title><link>http://www.cppblog.com/huahit/archive/2006/05/30/3874.html#7873</link><dc:creator>funny</dc:creator><author>funny</author><pubDate>Tue, 30 May 2006 06:07:00 GMT</pubDate><guid>http://www.cppblog.com/huahit/archive/2006/05/30/3874.html#7873</guid><description><![CDATA[想问一个VC++连接SQL SERVER 2000个人版的问题.<br><br>提示错误为:warning C4129: 'S' : unrecognized character escape sequence<br><br><br>连接时我的代码为：<br>m_pConnection.CreateInstance(&quot;ADODB.Connection&quot;);<br>		<br>		m_pConnection-&gt;Open(&quot;Provider=SQLOLEDB;Server=JINAN-JEL9I8QQ2\STORE;Database=FStore; uid=sa; pwd=funny817&quot;,&quot;&quot;,&quot;&quot;,adModeUnknown);<br><br><br>可是却无法连接上，请问原因？？？<img src ="http://www.cppblog.com/huahit/aggbug/7873.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huahit/" target="_blank">funny</a> 2006-05-30 14:07 <a href="http://www.cppblog.com/huahit/archive/2006/05/30/3874.html#7873#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 快速修改网卡物理地址方法二则 </title><link>http://www.cppblog.com/huahit/archive/2006/03/08/3886.html#3889</link><dc:creator>无为斋</dc:creator><author>无为斋</author><pubDate>Wed, 08 Mar 2006 04:38:00 GMT</pubDate><guid>http://www.cppblog.com/huahit/archive/2006/03/08/3886.html#3889</guid><description><![CDATA[不错啊<img src ="http://www.cppblog.com/huahit/aggbug/3889.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/huahit/" target="_blank">无为斋</a> 2006-03-08 12:38 <a href="http://www.cppblog.com/huahit/archive/2006/03/08/3886.html#3889#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>