标题:急问ODBC访问数据库问题
只看楼主
wxchicken
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2004-12-5
 问题点数:0 回复次数:4 
急问ODBC访问数据库问题

c语言用ODBC访问access,编译时出错,都是头文件的错误,实在搞不明白,恳求各位大牛大虾们指教小弟!!急~~~~~~~~~~

#include <sql.h> #include <sqlext.h> #include <sqltypes.h> //#include <odbcss.h> //#include <odbcinst.h> #include <sqlucode.h> #include <stdio.h> #include <string.h> #include <conio.h> #include <stdlib.h> #include <ctype.h> #include <windows.h>

int main()

{

……………………

}

Compiling... odbc.c f:\microsoft visual studio\vc98\include\sqltypes.h(114) : error C2061: syntax error : identifier 'SQLHWND' f:\microsoft visual studio\vc98\include\sqltypes.h(114) : error C2059: syntax error : ';' f:\microsoft visual studio\vc98\include\sqltypes.h(252) : error C2061: syntax error : identifier 'DWORD' f:\microsoft visual studio\vc98\include\sqltypes.h(253) : error C2061: syntax error : identifier 'Data2' f:\microsoft visual studio\vc98\include\sqltypes.h(253) : error C2059: syntax error : ';' f:\microsoft visual studio\vc98\include\sqltypes.h(254) : error C2061: syntax error : identifier 'Data3' f:\microsoft visual studio\vc98\include\sqltypes.h(254) : error C2059: syntax error : ';' f:\microsoft visual studio\vc98\include\sqltypes.h(255) : error C2061: syntax error : identifier 'Data4' f:\microsoft visual studio\vc98\include\sqltypes.h(255) : error C2059: syntax error : ';' f:\microsoft visual studio\vc98\include\sqltypes.h(255) : error C2059: syntax error : '[' f:\microsoft visual studio\vc98\include\sqltypes.h(256) : error C2059: syntax error : '}' f:\microsoft visual studio\vc98\include\sqlext.h(1678) : error C2146: syntax error : missing ')' before identifier 'hwnd' f:\microsoft visual studio\vc98\include\sqlext.h(1678) : error C2081: 'SQLHWND' : name in formal parameter list illegal f:\microsoft visual studio\vc98\include\sqlext.h(1678) : error C2061: syntax error : identifier 'hwnd' f:\microsoft visual studio\vc98\include\sqlext.h(1678) : error C2059: syntax error : ';' f:\microsoft visual studio\vc98\include\sqlext.h(1678) : error C2059: syntax error : ',' f:\microsoft visual studio\vc98\include\sqlext.h(1684) : error C2059: syntax error : ')' f:\microsoft visual studio\vc98\include\sqlext.h(2009) : error C2143: syntax error : missing '{' before '__stdcall' f:\microsoft visual studio\vc98\include\sqlext.h(2010) : error C2143: syntax error : missing '{' before '__stdcall' f:\microsoft visual studio\vc98\include\sqlext.h(2026) : error C2143: syntax error : missing ';' before '*' f:\microsoft visual studio\vc98\include\sqlext.h(2026) : error C2059: syntax error : '*' f:\microsoft visual studio\vc98\include\sqlext.h(2027) : error C2061: syntax error : identifier 'dwFlags' f:\microsoft visual studio\vc98\include\sqlext.h(2027) : error C2059: syntax error : ';' f:\microsoft visual studio\vc98\include\sqlext.h(2029) : error C2061: syntax error : identifier 'WCHAR' f:\microsoft visual studio\vc98\include\sqlext.h(2030) : error C2143: syntax error : missing '{' before '*' f:\microsoft visual studio\vc98\include\sqlext.h(2031) : error C2059: syntax error : '}' f:\microsoft visual studio\vc98\include\sqlext.h(2033) : error C2061: syntax error : identifier 'WCHAR' f:\microsoft visual studio\vc98\include\sqlext.h(2034) : error C2143: syntax error : missing '{' before '*' f:\microsoft visual studio\vc98\include\sqlext.h(2035) : error C2059: syntax error : '}' f:\microsoft visual studio\vc98\include\sqlext.h(2037) : error C2059: syntax error : '}' f:\microsoft visual studio\vc98\include\sqlext.h(2038) : error C2143: syntax error : missing '{' before '__stdcall' f:\microsoft visual studio\vc98\include\sqlucode.h(270) : error C2146: syntax error : missing ')' before identifier 'hwnd' f:\microsoft visual studio\vc98\include\sqlucode.h(270) : error C2081: 'SQLHWND' : name in formal parameter list illegal f:\microsoft visual studio\vc98\include\sqlucode.h(270) : error C2061: syntax error : identifier 'hwnd' f:\microsoft visual studio\vc98\include\sqlucode.h(270) : error C2059: syntax error : ';' f:\microsoft visual studio\vc98\include\sqlucode.h(270) : error C2059: syntax error : ',' f:\microsoft visual studio\vc98\include\sqlucode.h(276) : error C2059: syntax error : ')' f:\microsoft visual studio\vc98\include\sqlucode.h(627) : error C2146: syntax error : missing ')' before identifier 'hwnd' f:\microsoft visual studio\vc98\include\sqlucode.h(627) : error C2081: 'SQLHWND' : name in formal parameter list illegal f:\microsoft visual studio\vc98\include\sqlucode.h(627) : error C2061: syntax error : identifier 'hwnd' f:\microsoft visual studio\vc98\include\sqlucode.h(627) : error C2059: syntax error : ';' f:\microsoft visual studio\vc98\include\sqlucode.h(627) : error C2059: syntax error : ',' f:\microsoft visual studio\vc98\include\sqlucode.h(633) : error C2059: syntax error : ')' Error executing cl.exe.

odbc.obj - 43 error(s), 0 warning(s)

搜索更多相关主题的帖子: ODBC 数据库 访问 
2004-12-05 17:23
时空之蕊
Rank: 2
等 级:新手上路
威 望:3
帖 子:691
专家分:0
注 册:2004-10-31
得分:0 
不知道是不是标准的c库部!还有你的编译环境是什么!

我渴望掌控时空的核心——用最先进的技术,打造无比美丽的世界!
2004-12-05 18:18
wxchicken
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2004-12-5
得分:0 
我是在VC6.0下编译的,标不标准我也不清楚,怎么看啊?如果不是还要下载标准库文件么?还是可以进行转换什么的?
2004-12-06 09:49
live41
Rank: 10Rank: 10Rank: 10
等 级:贵宾
威 望:67
帖 子:12442
专家分:0
注 册:2004-7-22
得分:0 

是不是没有选择好插入组件

2004-12-06 10:27
wxchicken
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2004-12-5
得分:0 
终于弄好了,还是main函数的问题,真是不好意思,多谢斑竹指教:)
2004-12-06 11:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-8881-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.205230 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved