用C连接MSSQL数据库,用的是MSSQL下的自带例子,为什么会出现SQLFRONT.H文件中有错误?
SQL.c文件
#define DBNTWIN32
#include <sqlfront.h>
#include <sqldb.h>
main()
{
DBPROCESS *dbproc;
LOGINREC *login;
RETCODE r;
dbinit();
login = dblogin();
if (login == NULL)
return (1);
DBSETLUSER(login, "my_login");
DBSETLPWD(login, "my_password");
dbproc = dbopen(login, "my_server");
dbfreelogin(login);
if (dbproc == NULL)
return (1);
dbuse(dbproc, "pubs");
dbcmd(dbproc,
"select au_fname from authors where au_lname = 'White'");
r = dbsqlexec(dbproc);
if (r == FAIL)
return (1);
while (1)
{
r = dbresults(dbproc);
if (r == SUCCEED)
{
/* Process the rows with dbnextrow() */
}
if ((r == FAIL) || (r == NO_MORE_RESULTS))
break;
}
return (0);
}
TC编译时老是报Sqlfront.h 文件有错,像 Error C:\TURBOC2\INCLUDE\SQLFRONT.H 87: Declaration syntax error 之类的。而Sqlfront.h 等头文件都是用MSSQL的自带的,这是为什么?