救急,这是什么错误???

huyueyou 2002-11-27 04:10:19
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLConnect@28
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLAllocConnect@8
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLAllocEnv@4
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLFreeEnv@4
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLFreeConnect@4
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLDisconnect@4
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLFreeStmt@8
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLFreeStmt@8
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLExecDirect@12
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLExecDirect@12
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLAllocStmt@8
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLAllocStmt@8
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLExecute@4
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLExecute@4
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLPrepare@12
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLPrepare@12
ODBCDatabase.obj : error LNK2001: unresolved external symbol _SQLError@32
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLFetch@4
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLSetStmtOption@12
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLDescribeCol@36
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLNumResultCols@8
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLExtendedFetch@20
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLSetPos@16
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLGetData@24
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLGetStmtOption@12
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLBindCol@24
ODBCRECORDSET.OBJ : error LNK2001: unresolved external symbol _SQLBindParameter@40
Debug/Book.exe : fatal error LNK1120: 22 unresolved externals
Error executing link.exe.


这又是什么错误???



有个try中的CATCH(CDBException,e)
给出了以下错误:



E:\VC学习\数据库\Book\BookDlg.cpp(237) : error C2061: syntax error : identifier 'CDBException'
E:\VC学习\数据库\Book\BookDlg.cpp(237) : error C2310: catch handlers must specify one type
E:\VC学习\数据库\Book\BookDlg.cpp(237) : error C2065: 'e' : undeclared identifier
E:\VC学习\数据库\Book\BookDlg.cpp(237) : error C2227: left of '->IsKindOf' must point to class/struct/union
E:\VC学习\数据库\Book\BookDlg.cpp(237) : error C2653: 'CDBException' : is not a class or namespace name
E:\VC学习\数据库\Book\BookDlg.cpp(237) : error C2065: 'classCDBException' : undeclared identifier
E:\VC学习\数据库\Book\BookDlg.cpp(237) : error C2440: '=' : cannot convert from 'int' to 'class CException *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
E:\VC学习\数据库\Book\BookDlg.cpp(239) : error C2227: left of '->ReportError' must point to class/struct/union
E:\VC学习\数据库\Book\BookDlg.cpp(242) : error C2317: 'try' block starting on line '233' has no catch handlers
Error executing cl.exe.

拜托高手帮忙了(一个ODBC API程序例子),谢谢了

...全文
86 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
hanwg 2002-11-27
  • 打赏
  • 举报
回复
(1)在Setiing 中的link里添加静态库odebc32.lib
(2)在stdafx.h添加 #include <afxdb.h>
qfpcn 2002-11-27
  • 打赏
  • 举报
回复
很多原因会引起第一种连接错误!
第二种错误的原因我估计你没有在BookDlg.cpp中包含相应的头文件!
zfive 2002-11-27
  • 打赏
  • 举报
回复
odbc32.lib没有找到
nbgyf 2002-11-27
  • 打赏
  • 举报
回复
1.不太清楚;

将编译的连接库Share改为或Static改为Share,试试;

2.有个try中的CATCH(CDBException,e)
给出了以下错误:

try
{
}
catch(CDBException *e)
{
delete e;
}

给我62分,我就有颗星了;

解决了问题;

别忘了;

谢谢

4,011

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 数据库
社区管理员
  • 数据库
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧