易截截图软件、单文件、免安装、纯绿色、仅160KB

使用ADO通过ODBC连接MYSQL >MFC工程

1.配置名字为myodbc的数据源
2.在stdafx.h中加上
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename ("EOF", "adoEOF")
3.在程序初始化的方法中加上
AfxEnableControlContainer();
// 初始化COM,创建ADO连接等操作
AfxOleInit();
4.在合适的地方加上
public:_ConnectionPtr m_pConnection;
5.连接mysql
m_pConnection.CreateInstance(__uuidof(Connection));
// 在ADO操作中建议语句中要常用try...catch()来捕获错误信息,因为它有时会经常出现一些想不到的错误。
try
{
// 打开本地Access库student.mdb
m_pConnection->Open("myodbc","","",adModeUnknown);
}
catch(_com_error e)
{
AfxMessageBox(_T("数据库连接失败,!"));
return FALSE;
}


相关文档:

解决MySQL不允许从远程访问的方法

1。 改表法。可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称"%"
mysql -u root -p   
mysql>use mysql;   
mysql>update user set& ......

mysql forige key


Love in coding...
    Free and Susan
[引]MySQL INNODB类型表的外键关联设置

Here is a simple example that relates parent and child tables through a single-column foreign key:
CREATE TABLE parent (id INT NOT NULL,
          ......

VC++ 连接MySQL 数据库

把mysql.h复制到vc的目录的include目录下
mysql.h在你mysql的安装目录下的include里面如:mysql\include
把libmysql.lib(在mysql的安装目录下,搜索下就能找到)复制到这个目录下(C:\Program Files\Microsoft Visual Studio 9.0\VC\lib),要不连接会出错。
如果编译连接时还是出错。就把libmysql.lib复制到你源程序的目 ......

MySQL Cluster Multi Computer Installation

    
Each MySQL Cluster host computer running an SQL node must have
installed on it a MySQL binary. For management nodes and data
nodes, it is not necessary to install the MySQL server binary, but
management nodes require the management server daemon
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号