c++ - 通过c++ xll的sql连接

标签 c++ sql visual-studio-2008 excel-2007 xll

我正在尝试用 c++ 编写一个 xll 来与 sql server 交互。 程序编译正常。我在 C++ 代码中有以下简单的几行

database.test(){
              ....
    sql::Driver *driver;
    sql::Connection *con;
    sql::Statement *stmt;
    sql::ResultSet *res;
    con = driver->connect("NJROS1LD120", "mysql","mysql01"); 
              ... }

现在,当我尝试打开 excel 时,我在 excel 单元格中看到垃圾字符,第一行显示“此程序无法在 DOS 模式下运行”。 如果我注释掉 con = driver->connect("NJROS1LD120", "mysql","mysql01"); 我可以在插件中看到函数 database.test() 。

无法弄清楚出了什么问题。如果有人愿意提供帮助,那真是太好了。

谢谢

最佳答案

你离家很远。查看http://xll.codeplex.com .至少它会让你创建一个没有可怕的 DOS 模式错误的插件。您是否尝试使用 ODBC 驱动程序连接到 MySQL 数据库?

关于c++ - 通过c++ xll的sql连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12113248/

相关文章:

C++ 编译错误 : ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

c++ - 编译器内存优化 - 重用现有 block

php - 列出 in_array 中的表

sql - 多种登录方式的表格设计

php - MySQL查询根据投票加入2个表

visual-studio - 如何将 ILMerge 集成到 Visual Studio 构建过程中以合并程序集?

c++ - C++中的输出流

c++ - 如何通过引用传递 vector 的静态 vector ?

visual-studio - 是否可以在 Visual Studio 解决方案 (.sln) 文件中编辑项目路径而不更新 GUID?

c# - 单个 SQL Server 表上的死锁