易截截图软件、单文件、免安装、纯绿色、仅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,
          ......

mysql 一些简单操作 Rubicon

了解了一些最基本的操作命令后,我们再来学习如何创建一个数据库和数据库表。
  1、使用SHOW语句找出在服务器上当前存在什么数据库:
mysql> SHOW DATABASES; +----------+
| Database | +----------+ | mysql |
| test | +----------+ 3 rows in set (0.00 sec)
  2、创建一个数据库abccs
  mysql> ......

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
......

Safe Shutdown and Restart of MySQL Cluster


To shut down the cluster, enter the following command in a shell
on the machine hosting the management node:

shell> ndb_mgm -e shutdown
The -e
option here is used to pass a command to
the ndb_mgm
client from the shell. (See
Section 4.23, “ ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号