直接通过odbc读、写excel表格文件
译者:徐景周
想要通过odbc直接读、写excel表格文件,首先,应确保odbc中已安装有excel表格文件的驱动"microsoft excel driver (*.xls)"。然后,可根据下面步骤进行:
1. 在stdafx.h文件中加入:
include <afxdb.h>
include <odbcinst.h>
2. 通过odbc直接创建excel文件(暂定文件名:demo.xls)
//创建并写入excel文件
void crwexcel::writetoexcel()
{
cdatabase database;