标题:出错了!!!
取消只看楼主
李贤昌
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2007-12-15
 问题点数:0 回复次数:0 
出错了!!!
// lxc.cpp : Defines the entry point for the console application.
#include <stdio.h>
#include <stdlib.h>
EXEC SQL INCLUDE SQLCA;   /*注意:不是SQLCA.H */   
/*定义SQL通信区,大小写有别,文件名SQLCA.H是大写的*/
/*SQLCA.H在C:\Program Files\Microsoft SQL Server\devtools\include中*/
int main()
{
EXEC SQL BEGIN DECLARE SECTION;  /*主变量说明开始*/
char HSno[10];
char HSname[12];
char HSsex[4];
EXEC SQL END DECLARE SECTION;    /*主变量说明结束*/
int count=0;
EXEC SQL CONNECT TO DELL-WJ.recrt USER sa.sa;
if (sqlca->sqlcode==0)
{
  printf("\n%s\n","Connect to recrt Success.");
}
else
{
  printf("\n%s\n","Connect to recrt Failed.");
  return(1);
}
EXEC SQL use recrt;
EXEC SQL DECLARE SX CURSOR FOR
SELECT Sno,Sname,Ssex FROM Student WHERE Sdept='CS';
EXEC SQL OPEN SX;
do {
 EXEC SQL fetch SX into :HSno,:HSname,:HSsex;
 if (sqlca->sqlcode !=0)
  break;
 if(count++==0)              /*先打出行头*/
  printf("%16s,%12s,%10s \n","Sno","Sname","Ssex");
 printf("%16s,%12s,%10s \n",HSno,HSname,HSsex);
   /*打印查询结果*/
}while(1);
EXEC SQL CLOSE SX; /*关闭游标SX不再和查询结果对应*/
EXEC SQL DEALLOCATE SX;  /*释放游标*/
EXEC SQL DISCONNECT all;   /*断开所有数据库连接*/
return 0;
}


--------------------Configuration: lxc - Win32 Debug--------------------
Compiling...
lxc.cpp
e:\新建文件夹lxc\c语言\lxc\lxc.cpp(45) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.

lxc.exe - 1 error(s), 0 warning(s)

是什么错误啊!
搜索更多相关主题的帖子: count include Microsoft 通信 
2008-01-15 13:47



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




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

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