【急!!】一个关于“通过ODBC读、写Excel表格文件”的程序,别人都运行成功出结果了,到我这边就出错

来源:百度知道 编辑:UC知道 时间:2024/05/29 20:00:28
一个关于“通过ODBC读、写Excel表格文件”的程序,别人都运行成功出结果了,到我这边就出错,顺序如下:
1)我解压,双击.dsw文件,编译,错误为:“Cannot open precompiled header file: 'Debug/ExcelAccess.pch': No such file or directory”;
2)我设置“工程——设置——C++——预编译的头文件——不使用预补偿页眉(或者自动使用预补偿页眉 。。因为我看网上说这两种的都有,都试过,不过后面一样都会出现错误)”,错误为“error C2061: syntax error : identifier 'SQLHWND'”,分别在三个不同的地方;
3)检查#include <windows.h> #include <sqlext.h>都是有的,因为我看网上有说可能是未包含#include <windows.h>;
4)再点编译,弹出消息“
sqlucode.h, This file is not in the project.would you like to add it?”,选yes,又报错“cannot compile the file 'D:\program files\microsift visual studio\VC98\Include\sqlucode.h':no compile tool is associated with the file extension.”
5)之后不管怎么样,关闭vc重启也一样,点编译就报错“cannot compile the file 'D:\program files\microsift visual studio\VC98\Include\sqlucode.h':no compile tool is associated with the file extension.”,如果直接点链接,就报“error C2061: syntax error : identifier 'SQLHWND&#

你的程序我编译一点问题也没有。你的vc有问题?

我用的是vc 6.0 sp3英文 版本

你用的什么?

这是我用的结果

2008-09-06 20:12 33,792 good.ncb
2008-09-06 20:12 48,640 good.opt
2008-09-06 20:12 304,128 good.pdb
2008-09-06 20:12 1,512 good.plg
2008-09-05 13:14 1,457 good.rc
2008-09-05 13:14 445 Resource.h
2008-09-05 13:14 291 StdAfx.cpp
2008-09-05 14:56 1,168 StdAfx.h
2008-09-05 21:17 1,571 说明.txt
18 个文件 722,985 字节
3 个目录 34,785,833,472 可用字节

F:\_mgen2\good>good
Usage: good excelfile tablename
F:\_mgen2\good>good dose.xls n
CDBException: 'n$' 不是一个有效名称。请确认它不包含无效的字符或标点,且名称不太
长。
F:\_mgen2\good>good dose.xls Data
CDBException: 表 'Data' 已存在。
F:\_mgen2\good>