使用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;
}
相关文档:
运行环境:windows xp sp2
IIS v5.1
PHP 5.3.1-Win32-VC9-x86
Mysql 5.0
安装步骤:
安装IIS5.1
在 ......
create procedure all_joiner_message( in captions varchar(255), in contents text, in objectid int, in types int , out count int)
begin
declare userids int;
DECLARE _done IN ......
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,
......
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
......